summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-07 18:15:39 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-10 11:48:35 +0200
commitc860f9a41e4edde38f6fb5a98775ab9194212216 (patch)
tree2346d1835474f491b19c5846d13ac3412895d5d7 /examples
parentca88edb0fdbb73b4d9e29d78975ee755f9c1853e (diff)
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
Diffstat (limited to 'examples')
-rw-r--r--examples/sccp_test_server.c3
-rw-r--r--examples/sccp_test_vty.c1
2 files changed, 4 insertions, 0 deletions
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;
}