[sr-dev] git:3.1: tm: free parsed body for faked requests

Daniel-Constantin Mierla miconda at gmail.com
Sat Feb 5 10:26:15 CET 2011


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sat Feb  5 07:08:53 2011 +0100

tm: free parsed body for faked requests

- if sdp body was parsed in a failure route, the structure was left
  uncleared
- reported by Bayan Towfiq, credits for troubleshooting access to live
  server
- credits also to Ovidiu Sas for assistance with sdp parser
(cherry picked from commit 7a1a5ffff6a6dbf89f42ccb9f15d588d8bfe62d0)

---

 modules/tm/t_reply.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 382244f..c18c716 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -909,6 +909,12 @@ void free_faked_req(struct sip_msg *faked_req, struct cell *t)
 			hdr->parsed = 0;
 		}
 	}
+	/* free parsed body added by failure handlers */
+	if (faked_req->body) {
+		if(faked_req->body->free)
+			faked_req->body->free(&faked_req->body);
+		faked_req->body = 0;
+	}
 }
 
 




More information about the sr-dev mailing list