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

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
(cherry picked from commit 8ec30688617a260d478402e59ef465c69e8247d9)

---

 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 28e8ab0..2774a2c 100644
--- a/parser/sdp/sdp.c
+++ b/parser/sdp/sdp.c
@@ -667,8 +667,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++;
@@ -748,6 +747,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