[sr-dev] git:master: topoh: free nbuf

Daniel-Constantin Mierla miconda at gmail.com
Wed Apr 7 22:58:04 CEST 2010


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Apr  7 22:56:46 2010 +0200

topoh: free nbuf

- fixed leak due to no free of new buffer
- reported by Libor Chocholaty

---

 modules/topoh/topoh_mod.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/topoh/topoh_mod.c b/modules/topoh/topoh_mod.c
index 7dd3ec6..a1f3fd2 100644
--- a/modules/topoh/topoh_mod.c
+++ b/modules/topoh/topoh_mod.c
@@ -184,7 +184,7 @@ int th_msg_received(void *data)
 {
 	sip_msg_t msg;
 	str *obuf;
-	char *nbuf;
+	char *nbuf = NULL;
 	int direction;
 	int dialog;
 
@@ -256,6 +256,8 @@ int th_msg_received(void *data)
 	obuf->s[obuf->len] = '\0';
 
 done:
+	if(nbuf!=NULL)
+		pkg_free(nbuf);
 	free_sip_msg(&msg);
 	return 0;
 }




More information about the sr-dev mailing list