[sr-dev] git:master:5272c8a2: tm: free proxy structure in latest kemi export

Daniel-Constantin Mierla miconda at gmail.com
Mon Dec 14 07:34:55 CET 2020


Module: kamailio
Branch: master
Commit: 5272c8a2ec910e5d9e37067e94089a42a5198fd9
URL: https://github.com/kamailio/kamailio/commit/5272c8a2ec910e5d9e37067e94089a42a5198fd9

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-12-14T07:34:07+01:00

tm: free proxy structure in latest kemi export

---

Modified: src/modules/tm/tm.c

---

Diff:  https://github.com/kamailio/kamailio/commit/5272c8a2ec910e5d9e37067e94089a42a5198fd9.diff
Patch: https://github.com/kamailio/kamailio/commit/5272c8a2ec910e5d9e37067e94089a42a5198fd9.patch

---

diff --git a/src/modules/tm/tm.c b/src/modules/tm/tm.c
index fcc312aeb6..4113743f3f 100644
--- a/src/modules/tm/tm.c
+++ b/src/modules/tm/tm.c
@@ -2927,7 +2927,8 @@ static int ki_t_relay_to_proto_addr(sip_msg_t *msg, str *sproto, str *host, int
 {
 
 	int proto = PROTO_NONE;
-	struct proxy_l *proxy;
+	proxy_l_t *proxy = NULL;
+	int ret = -1;
 
 	if (sproto != NULL && sproto->s != NULL && sproto->len == 3) {
 		if (strncasecmp(sproto->s, "UDP", 3) == 0) {
@@ -2947,7 +2948,10 @@ static int ki_t_relay_to_proto_addr(sip_msg_t *msg, str *sproto, str *host, int
 		       host->s, port );
 		return E_BAD_ADDRESS;
 	}
-	return _w_t_relay_to(msg, proxy, proto);
+	ret = _w_t_relay_to(msg, proxy, proto);
+	free_proxy(proxy);
+	pkg_free(proxy);
+	return ret;
 }
 
 /**




More information about the sr-dev mailing list