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

Author: Vicente Hernando <[email protected]>
Committer: Vicente Hernando <[email protected]>
Date:   Wed Sep  5 06:44:39 2012 -0400

sdpops: Fix memory leakage in w_get_sdp function.
(cherry picked from commit d1d2494c966d65828d1920296056da840a11efd9)

---

 modules/sdpops/sdpops_mod.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/modules/sdpops/sdpops_mod.c b/modules/sdpops/sdpops_mod.c
index df7d6e6..b70b553 100644
--- a/modules/sdpops/sdpops_mod.c
+++ b/modules/sdpops/sdpops_mod.c
@@ -974,14 +974,8 @@ static int w_get_sdp(sip_msg_t* msg, char *avp)
                LM_DBG("No SDP\n");
                return -2;
        } else {
-               avp_val.s.s = pkg_malloc(sdp->raw_sdp.len);
+               avp_val.s.s = sdp->raw_sdp.s;
                avp_val.s.len = sdp->raw_sdp.len;
-               if (avp_val.s.s == NULL)
-               {
-                 LM_ERR("Failed to alloc memory for SDP");
-                 return -1;
-               }
-               memcpy(avp_val.s.s, sdp->raw_sdp.s, avp_val.s.len);
                LM_DBG("Found SDP %.*s\n", sdp->raw_sdp.len, sdp->raw_sdp.s);
        }
        if (add_avp(AVP_VAL_STR | avp_type, avp_name, avp_val) != 0)


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

Reply via email to