[sr-dev] git:master: tm: faked request fields are freed using wrapper functions from core

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 19 13:28:08 CEST 2013


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Sep 19 13:24:57 2013 +0200

tm: faked request fields are freed using wrapper functions from core

---

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

diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 97b813f..e3aa49e 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -954,6 +954,7 @@ error00:
 	if (faked_req->dst_uri.s) {
 		pkg_free(faked_req->dst_uri.s);
 		faked_req->dst_uri.s = 0;
+		faked_req->dst_uri.len = 0;
 	}
 error01:
 	return 0;
@@ -963,15 +964,8 @@ void free_faked_req(struct sip_msg *faked_req, struct cell *t)
 {
 	struct hdr_field *hdr;
 
-	if (faked_req->new_uri.s) {
-		pkg_free(faked_req->new_uri.s);
-		faked_req->new_uri.s = 0;
-	}
-
-	if (faked_req->dst_uri.s) {
-		pkg_free(faked_req->dst_uri.s);
-		faked_req->dst_uri.s = 0;
-	}
+	reset_new_uri(faked_req);
+	reset_dst_uri(faked_req);
 
 	/* free all types of lump that were added in failure handlers */
 	del_nonshm_lump( &(faked_req->add_rm) );
@@ -997,6 +991,12 @@ void free_faked_req(struct sip_msg *faked_req, struct cell *t)
 			faked_req->body->free(&faked_req->body);
 		faked_req->body = 0;
 	}
+
+	/* free sip_msg_t fileds that can be set in pkg */
+	reset_path_vector(faked_req);
+	reset_instance(faked_req);
+	reset_ruid(faked_req);
+	reset_ua(faked_req);
 }
 
 




More information about the sr-dev mailing list