From c860f9a41e4edde38f6fb5a98775ab9194212216 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 7 Apr 2017 18:15:39 +0200 Subject: sigtran: fix various memory leaks (msgb and xua_msg) The general rule for 'struct xua_msg' is now that it is free'd by the function that also allocates it in the first place. Any downstream consumer of the xua_msg may interpret it, but not hold any references or free() it. Change-Id: I708505d129da5824c69b31a13a9c93201929bada --- examples/sccp_test_server.c | 3 +++ examples/sccp_test_vty.c | 1 + 2 files changed, 4 insertions(+) (limited to 'examples') diff --git a/examples/sccp_test_server.c b/examples/sccp_test_server.c index c3c658f..71bed96 100644 --- a/examples/sccp_test_server.c +++ b/examples/sccp_test_server.c @@ -34,6 +34,7 @@ static int refuser_prim_cb(struct osmo_prim_hdr *oph, void *_scu) oph->primitive, oph->operation); break; } + msgb_free(oph->msg); return 0; } @@ -71,6 +72,7 @@ static int echo_prim_cb(struct osmo_prim_hdr *oph, void *_scu) oph->primitive, oph->operation); break; } + msgb_free(oph->msg); return 0; } @@ -102,6 +104,7 @@ static int callback_prim_cb(struct osmo_prim_hdr *oph, void *_scu) oph->primitive, oph->operation); break; } + msgb_free(oph->msg); return 0; } diff --git a/examples/sccp_test_vty.c b/examples/sccp_test_vty.c index 1134d57..ddfbb27 100644 --- a/examples/sccp_test_vty.c +++ b/examples/sccp_test_vty.c @@ -125,6 +125,7 @@ static int testclnt_prim_cb(struct osmo_prim_hdr *oph, void *_scu) default: break; } + msgb_free(oph->msg); return 0; } -- cgit v1.2.3