aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-05-22 15:23:22 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-05-22 16:46:11 +0200
commit4f200491ff217e48ebc10f31e85386899b63dbd8 (patch)
tree54fd5ed4a4c10a1330e3942ac86dd53a989b9c8a
parent1cc5ff8e19c840545ae746c52995d0768c2d1f70 (diff)
osmux: Fix potential memory leak in the msgb handling
-rw-r--r--openbsc/src/libmgcp/osmux.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsc/src/libmgcp/osmux.c b/openbsc/src/libmgcp/osmux.c
index 3fdc652b0..f0c0c68ee 100644
--- a/openbsc/src/libmgcp/osmux.c
+++ b/openbsc/src/libmgcp/osmux.c
@@ -119,6 +119,7 @@ int osmux_xfrm_to_osmux(int type, char *buf, int rc, struct mgcp_endpoint *endp)
default:
/* Should not ever happen */
LOGP(DMGCP, LOGL_ERROR, "Bad type %d. Fix your code.\n", type);
+ msgb_free(msg);
return 0;
}
@@ -126,6 +127,7 @@ int osmux_xfrm_to_osmux(int type, char *buf, int rc, struct mgcp_endpoint *endp)
in = osmux_handle_lookup(endp->cfg, addr);
if (!in) {
LOGP(DMGCP, LOGL_ERROR, "No osmux handle, aborting\n");
+ msgb_free(msg);
return 0;
}