Module: sip-router
Branch: master
Commit: c9628aa038ad7099a72af67f9284e5d0a9b78173
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c9628aa…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Mon Aug 13 15:49:09 2012 +0100
modules_k/rls: Fixed memory leak in rls
- Issue fixed by Paul Pankhurst and Peter Dunkley @ Crocodile RCS
---
modules_k/rls/subscribe.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c
index 7df5d40..66c295a 100644
--- a/modules_k/rls/subscribe.c
+++ b/modules_k/rls/subscribe.c
@@ -463,6 +463,7 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str
watcher_doma
subs_t subs;
pres_ev_t* event = NULL;
int err_ret = -1;
+ int ret = to_presence_code;
str* contact = NULL;
xmlDocPtr doc = NULL;
xmlNodePtr service_node = NULL;
@@ -743,6 +744,8 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str
watcher_doma
remove_expired_rlsubs(&subs, hash_code);
done:
+ ret = 1;
+forpresence:
if(contact!=NULL)
{
if(contact->s!=NULL)
@@ -758,14 +761,7 @@ done:
xmlFreeDoc(doc);
if (rlsubs_did.s != NULL)
pkg_free(rlsubs_did.s);
- return 1;
-
-forpresence:
- if(subs.pres_uri.s!=NULL)
- pkg_free(subs.pres_uri.s);
- if (rlsubs_did.s != NULL)
- pkg_free(rlsubs_did.s);
- return to_presence_code;
+ return ret;
bad_event:
err_ret = 0;