[sr-dev] git:4.1:9e03ac74: mi_datagram: free async handler when command completed

Daniel-Constantin Mierla miconda at gmail.com
Wed Aug 26 13:23:49 CEST 2015


Module: kamailio
Branch: 4.1
Commit: 9e03ac7410c879dc9e91dd21c04c0597ce1ccff3
URL: https://github.com/kamailio/kamailio/commit/9e03ac7410c879dc9e91dd21c04c0597ce1ccff3

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-08-26T13:22:48+02:00

mi_datagram: free async handler when command completed

- reported by Torge Szczepanek, GH#298

(cherry picked from commit 374bfb1c467d6bf2a4cc143d22868c37143783bd)
(cherry picked from commit d495aafb98d3560c36b681dae21b671ce8b23e86)
(cherry picked from commit a4ca8feae11a8168ab600b2a648f85af1e792661)

---

Modified: modules/mi_datagram/datagram_fnc.c

---

Diff:  https://github.com/kamailio/kamailio/commit/9e03ac7410c879dc9e91dd21c04c0597ce1ccff3.diff
Patch: https://github.com/kamailio/kamailio/commit/9e03ac7410c879dc9e91dd21c04c0597ce1ccff3.patch

---

diff --git a/modules/mi_datagram/datagram_fnc.c b/modules/mi_datagram/datagram_fnc.c
index 66e821d..8ca0bbf 100644
--- a/modules/mi_datagram/datagram_fnc.c
+++ b/modules/mi_datagram/datagram_fnc.c
@@ -359,6 +359,7 @@ static void datagram_close_async(struct mi_root *mi_rpl,struct mi_handler *hdl,
 		}
 		free_mi_tree(mi_rpl);
 		pkg_free(dtgram.start);
+		if (done) free_async_handler( hdl );
 	} else if (done) {
 		mi_send_dgram(reply_sock, MI_COMMAND_FAILED, MI_COMMAND_FAILED_LEN,
 				(struct sockaddr*)&reply_addr, reply_addr_len, mi_socket_timeout);
@@ -372,6 +373,7 @@ static void datagram_close_async(struct mi_root *mi_rpl,struct mi_handler *hdl,
 	if(dtgram.start)
 		pkg_free(dtgram.start);
 	close(reply_sock);
+	if (done) free_async_handler( hdl );
 	return;
 }
 




More information about the sr-dev mailing list