Module: kamailio
Branch: 5.0
Commit: 04e5d5e8cc8f9593e2cc809dabb5c6303e7c3214
URL: https://github.com/kamailio/kamailio/commit/04e5d5e8cc8f9593e2cc809dabb5c63…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2017-02-22T08:16:25+01:00
pua_reginfo: fix memory leak when usrloc is DB_ONLY
As release_urecord() clearly says:
/*!
* \brief Release urecord previously obtained through get_urecord
* \warning Failing to calls this function after get_urecord will
* result in a memory leak when the DB_ONLY mode is used. When
* the records is later deleted, e.g. with delete_urecord, then
* its not necessary, as this function already releases the record.
* \param _r released record
*/
(cherry picked from commit 1b0e1c3cbdd162fcd438a7d9bb412ddce73bc214)
---
Modified: src/modules/pua_reginfo/notify.c
Modified: src/modules/pua_reginfo/usrloc_cb.c
---
Diff: https://github.com/kamailio/kamailio/commit/04e5d5e8cc8f9593e2cc809dabb5c63…
Patch: https://github.com/kamailio/kamailio/commit/04e5d5e8cc8f9593e2cc809dabb5c63…
---
diff --git a/src/modules/pua_reginfo/notify.c b/src/modules/pua_reginfo/notify.c
index 317f3e8..853dbcc 100644
--- a/src/modules/pua_reginfo/notify.c
+++ b/src/modules/pua_reginfo/notify.c
@@ -458,7 +458,7 @@ int process_body(str notify_body, udomain_t * domain) {
}
}
next_registration:
- // if (ul_record) ul.release_urecord(ul_record);
+ if (ul_record) ul.release_urecord(ul_record);
/* Unlock the domain for this AOR: */
if (aor_key.len > 0)
ul.unlock_udomain(domain, &aor_key);
diff --git a/src/modules/pua_reginfo/usrloc_cb.c b/src/modules/pua_reginfo/usrloc_cb.c
index 7f84788..3e00a0e 100644
--- a/src/modules/pua_reginfo/usrloc_cb.c
+++ b/src/modules/pua_reginfo/usrloc_cb.c
@@ -223,7 +223,7 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
publ_info_t publ;
str content_type;
udomain_t * domain;
- urecord_t * record;
+ urecord_t * record = NULL;
int res;
str uri = {NULL, 0};
str user = {NULL, 0};
@@ -332,6 +332,7 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
if(body->s) xmlFree(body->s);
pkg_free(body);
}
+ if(record) ul.release_urecord(record);
return;
}
Module: kamailio
Branch: master
Commit: 1b0e1c3cbdd162fcd438a7d9bb412ddce73bc214
URL: https://github.com/kamailio/kamailio/commit/1b0e1c3cbdd162fcd438a7d9bb412dd…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2017-02-22T08:14:55+01:00
pua_reginfo: fix memory leak when usrloc is DB_ONLY
As release_urecord() clearly says:
/*!
* \brief Release urecord previously obtained through get_urecord
* \warning Failing to calls this function after get_urecord will
* result in a memory leak when the DB_ONLY mode is used. When
* the records is later deleted, e.g. with delete_urecord, then
* its not necessary, as this function already releases the record.
* \param _r released record
*/
---
Modified: src/modules/pua_reginfo/notify.c
Modified: src/modules/pua_reginfo/usrloc_cb.c
---
Diff: https://github.com/kamailio/kamailio/commit/1b0e1c3cbdd162fcd438a7d9bb412dd…
Patch: https://github.com/kamailio/kamailio/commit/1b0e1c3cbdd162fcd438a7d9bb412dd…
---
diff --git a/src/modules/pua_reginfo/notify.c b/src/modules/pua_reginfo/notify.c
index 317f3e8..853dbcc 100644
--- a/src/modules/pua_reginfo/notify.c
+++ b/src/modules/pua_reginfo/notify.c
@@ -458,7 +458,7 @@ int process_body(str notify_body, udomain_t * domain) {
}
}
next_registration:
- // if (ul_record) ul.release_urecord(ul_record);
+ if (ul_record) ul.release_urecord(ul_record);
/* Unlock the domain for this AOR: */
if (aor_key.len > 0)
ul.unlock_udomain(domain, &aor_key);
diff --git a/src/modules/pua_reginfo/usrloc_cb.c b/src/modules/pua_reginfo/usrloc_cb.c
index 7f84788..3e00a0e 100644
--- a/src/modules/pua_reginfo/usrloc_cb.c
+++ b/src/modules/pua_reginfo/usrloc_cb.c
@@ -223,7 +223,7 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
publ_info_t publ;
str content_type;
udomain_t * domain;
- urecord_t * record;
+ urecord_t * record = NULL;
int res;
str uri = {NULL, 0};
str user = {NULL, 0};
@@ -332,6 +332,7 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
if(body->s) xmlFree(body->s);
pkg_free(body);
}
+ if(record) ul.release_urecord(record);
return;
}
As release_urecord() clearly says:
/*!
* \brief Release urecord previously obtained through get_urecord
* \warning Failing to calls this function after get_urecord will
* result in a memory leak when the DB_ONLY mode is used. When
* the records is later deleted, e.g. with delete_urecord, then
* its not necessary, as this function already releases the record.
* \param _r released record
*/
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/998
-- Commit Summary --
* pua_reginfo: fix memory leak when usrloc is DB_ONLY
-- File Changes --
M src/modules/pua_reginfo/notify.c (2)
M src/modules/pua_reginfo/usrloc_cb.c (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/998.patchhttps://github.com/kamailio/kamailio/pull/998.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/998
Module: kamailio
Branch: master
Commit: 15b746b93548bf3d45b69018c175f4a521f16c20
URL: https://github.com/kamailio/kamailio/commit/15b746b93548bf3d45b69018c175f4a…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2017-02-21T15:46:22+01:00
modules: readme files regenerated - pua ... [skip ci]
---
Modified: src/modules/pua/README
---
Diff: https://github.com/kamailio/kamailio/commit/15b746b93548bf3d45b69018c175f4a…
Patch: https://github.com/kamailio/kamailio/commit/15b746b93548bf3d45b69018c175f4a…
---
diff --git a/src/modules/pua/README b/src/modules/pua/README
index c6116b8..22fd964 100644
--- a/src/modules/pua/README
+++ b/src/modules/pua/README
@@ -120,18 +120,17 @@ Chapter 1. Admin Guide
Kamailio's SIP presence package, implementing SIMPLE and various shared
line appearance implementations.
- It can be used with the following modules: pua_mi, pua_usrloc, pua_bla,
- pua_dialoginfo, pua_reginfo and pua_xmpp. The pua_mi module offer the
- possibility to publish any kind of information or subscribing to a
- resource through the manager interface. The pua_usrloc module calls a
- function exported by pua modules to publish elementary presence
- information, such as basic status "open" or "closed", for clients that
- do not implement client-to-server presence. Through pua_bla , BRIDGED
- LINE APPEARANCE features are added to Kamailio The pua_xmpp module
- represents a gateway between SIP and XMPP, so that jabber and SIP
- clients can exchange presence information. The pua_reginfo modules
- presents registration information from the usrloc module using the
- reginfo event package.
+ It can be used with the following modules: pua_rpc, pua_usrloc,
+ pua_bla, pua_dialoginfo, pua_reginfo and pua_xmpp. The pua_rpc module
+ offer the possibility to publish any kind of information via the RPC
+ transport. The pua_usrloc module calls a function exported by pua
+ modules to publish elementary presence information, such as basic
+ status "open" or "closed", for clients that do not implement
+ client-to-server presence. Through pua_bla , BRIDGED LINE APPEARANCE
+ features are added to Kamailio The pua_xmpp module represents a gateway
+ between SIP and XMPP, so that jabber and SIP clients can exchange
+ presence information. The pua_reginfo modules presents registration
+ information from the usrloc module using the reginfo event package.
The module supports 2 modes of operation. In the first a cache is used
to store the presentity list and writes to database on timer to be able
Module: kamailio
Branch: 5.0
Commit: 7dc1f60d6713527d182f4414365eed2546f82a90
URL: https://github.com/kamailio/kamailio/commit/7dc1f60d6713527d182f4414365eed2…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2017-02-21T15:21:17+01:00
pua: update documentation, replace pua_mi reference with pua_rpc
[skip ci]
(cherry picked from commit dbac66fa165d4058973a49d7ca9035b7ce7b07d2)
---
Modified: src/modules/pua/doc/pua_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/7dc1f60d6713527d182f4414365eed2…
Patch: https://github.com/kamailio/kamailio/commit/7dc1f60d6713527d182f4414365eed2…
---
diff --git a/src/modules/pua/doc/pua_admin.xml b/src/modules/pua/doc/pua_admin.xml
index 8df2c27..51d0fa3 100644
--- a/src/modules/pua/doc/pua_admin.xml
+++ b/src/modules/pua/doc/pua_admin.xml
@@ -22,10 +22,9 @@
implementations.
</para>
<para>
- It can be used with the following modules: pua_mi, pua_usrloc,
+ It can be used with the following modules: pua_rpc, pua_usrloc,
pua_bla, pua_dialoginfo, pua_reginfo and pua_xmpp.
- The <emphasis>pua_mi</emphasis> module offer the possibility to publish any kind of information
- or subscribing to a resource through the manager interface.
+ The <emphasis>pua_rpc</emphasis> module offer the possibility to publish any kind of information via the RPC transport.
The <emphasis>pua_usrloc</emphasis> module calls a function exported by pua modules to publish
elementary presence information, such as basic status "open" or "closed",
for clients that do not implement client-to-server presence.
Module: kamailio
Branch: master
Commit: dbac66fa165d4058973a49d7ca9035b7ce7b07d2
URL: https://github.com/kamailio/kamailio/commit/dbac66fa165d4058973a49d7ca9035b…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2017-02-21T15:19:02+01:00
pua: update documentation, replace pua_mi reference with pua_rpc
---
Modified: src/modules/pua/doc/pua_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/dbac66fa165d4058973a49d7ca9035b…
Patch: https://github.com/kamailio/kamailio/commit/dbac66fa165d4058973a49d7ca9035b…
---
diff --git a/src/modules/pua/doc/pua_admin.xml b/src/modules/pua/doc/pua_admin.xml
index 8df2c27..51d0fa3 100644
--- a/src/modules/pua/doc/pua_admin.xml
+++ b/src/modules/pua/doc/pua_admin.xml
@@ -22,10 +22,9 @@
implementations.
</para>
<para>
- It can be used with the following modules: pua_mi, pua_usrloc,
+ It can be used with the following modules: pua_rpc, pua_usrloc,
pua_bla, pua_dialoginfo, pua_reginfo and pua_xmpp.
- The <emphasis>pua_mi</emphasis> module offer the possibility to publish any kind of information
- or subscribing to a resource through the manager interface.
+ The <emphasis>pua_rpc</emphasis> module offer the possibility to publish any kind of information via the RPC transport.
The <emphasis>pua_usrloc</emphasis> module calls a function exported by pua modules to publish
elementary presence information, such as basic status "open" or "closed",
for clients that do not implement client-to-server presence.