[sr-dev] git:master: modules_k/rls: Fixed memory leak in rls under some error conditions

Peter Dunkley peter.dunkley at crocodile-rcs.com
Tue Aug 14 16:53:32 CEST 2012


Module: sip-router
Branch: master
Commit: de8b241ea39284cce4c7e1850fcf3cef4c4c4a0a
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=de8b241ea39284cce4c7e1850fcf3cef4c4c4a0a

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Tue Aug 14 15:52:37 2012 +0100

modules_k/rls: Fixed memory leak in rls under some error conditions

- Found and fixed by Hugh Waite @ Crocodile RCS

---

 modules_k/rls/subscribe.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c
index 66c295a..f719754 100644
--- a/modules_k/rls/subscribe.c
+++ b/modules_k/rls/subscribe.c
@@ -657,7 +657,8 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_doma
 					LM_ERR("while sending reply\n");
 					goto error;
 				}
-				return 0;
+				ret = 0;
+				goto stop;
 			}
 
 			/* if correct reply with 200 OK */
@@ -705,7 +706,8 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_doma
 					LM_ERR("while sending reply\n");
 					goto error;
 				}
-				return 0;
+				ret = 0;
+				goto stop;
 			}
 		}	
 		if(rls_get_service_list(&subs.pres_uri, &subs.watcher_user,
@@ -745,6 +747,7 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_doma
 
 done:
 	ret = 1;
+stop:
 forpresence:
 	if(contact!=NULL)
 	{	




More information about the sr-dev mailing list