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

Author: Peter Dunkley <peter.dunk...@crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunk...@crocodile-rcs.com>
Date:   Wed Dec 12 15:24:38 2012 +0000

parser/sdp: Fixed double free

- Found and fixed by Hugh Waite @ Crocodile RCS

---

 parser/sdp/sdp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/parser/sdp/sdp.c b/parser/sdp/sdp.c
index 134a676..df017be 100644
--- a/parser/sdp/sdp.c
+++ b/parser/sdp/sdp.c
@@ -665,8 +665,7 @@ static int parse_mixed_content(str *mixed_body, str 
delimiter, sdp_info_t* _sdp)
                        /* LM_DBG("we need to check session %d: <%.*s>\n", 
session_num, _sdp.raw_sdp.len, _sdp.raw_sdp.s); */
                        res = parse_sdp_session(&_sdp->raw_sdp, session_num, 
&cnt_disp, _sdp);
                        if (res != 0) {
-                               LM_DBG("free_sdp\n");
-                               free_sdp((sdp_info_t**)(void*)&(_sdp));
+                               /* _sdp is freed by the calling function */
                                return -1;
                        }
                        session_num++;
@@ -746,6 +745,7 @@ int parse_sdp(struct sip_msg* _m)
                                }
                                res = parse_mixed_content(&body, mp_delimiter, 
(sdp_info_t*)_m->body);
                                if (res != 0) {
+                                       LM_DBG("free_sdp\n");
                                        
free_sdp((sdp_info_t**)(void*)&_m->body);
                                }
                                return res;


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to