Module: sip-router
Branch: kamailio_3.0
Commit: 959eb339a44ada14b2b1a7aa551b0f36a2afd523
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=959eb339a44ada14b2b1a7aa551b0f36a2afd523

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
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
(cherry picked from commit 198e468b7d83bb62d0761dd45e5c6820bc75a61a)

---

 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 1d95c27..8146cbe 100644
--- a/modules/topoh/topoh_mod.c
+++ b/modules/topoh/topoh_mod.c
@@ -169,7 +169,7 @@ int th_msg_received(void *data)
 {
        sip_msg_t msg;
        str *obuf;
-       char *nbuf;
+       char *nbuf = NULL;
        int direction;
        int dialog;
 
@@ -241,6 +241,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;
 }


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to