[PATCH] osmo-mgw[master]: mgcp_test: test_no_cycle: sanitize: talloc endp from cfg

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sat Nov 18 20:30:56 UTC 2017


Review at  https://gerrit.osmocom.org/4919

mgcp_test: test_no_cycle: sanitize: talloc endp from cfg

Allocating the endp from NULL left a mem leak the sanitizer build complains
about. Allocating from cfg, which gets freed later, also frees the endp and its
connections.

Change-Id: I78d16ffc435c0f967fe99c6e38dde829b6fa0dc9
---
M tests/mgcp/mgcp_test.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/19/4919/1

diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 3dee509..8cdfb91 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -1233,7 +1233,7 @@
 
 	endp = &cfg->trunk.endpoints[1];
 
-	mgcp_conn_alloc(NULL, endp, 4711, MGCP_CONN_TYPE_RTP,
+	mgcp_conn_alloc(cfg, endp, 4711, MGCP_CONN_TYPE_RTP,
 			"test-connection");
 	conn = mgcp_conn_get_rtp(endp, 4711);
 	OSMO_ASSERT(conn);

-- 
To view, visit https://gerrit.osmocom.org/4919
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78d16ffc435c0f967fe99c6e38dde829b6fa0dc9
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list