osmux: Fix potential memory leak in the msgb handling
diff --git a/openbsc/src/libmgcp/osmux.c b/openbsc/src/libmgcp/osmux.c
index 3fdc652..f0c0c68 100644
--- a/openbsc/src/libmgcp/osmux.c
+++ b/openbsc/src/libmgcp/osmux.c
@@ -119,6 +119,7 @@
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 @@
in = osmux_handle_lookup(endp->cfg, addr);
if (!in) {
LOGP(DMGCP, LOGL_ERROR, "No osmux handle, aborting\n");
+ msgb_free(msg);
return 0;
}