summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-08-13 14:48:44 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-08-13 14:48:44 +0200
commit27876a2df0c76ab43f528f21d942d4461dc3a759 (patch)
tree00c6c4b2451a9a6087bdbf76ba730866d8b8e6d0
parent996215123011272d524dea859407b3c7e2aab2fd (diff)
nat: Fix potential memory leak when reading a message
Spotted while going through the code with Jacob. We could have leaked the msgb in case of error.
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_ussd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
index e0c5c6d..f7753fb 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
@@ -128,6 +128,7 @@ static int ussd_read_cb(struct osmo_fd *bfd)
if (ret < 0) {
LOGP(DNAT, LOGL_ERROR, "ignoring IPA response "
"message with malformed TLVs\n");
+ msgb_free(msg);
return ret;
}
if (TLVP_PRESENT(&tvp, IPAC_IDTAG_UNITNAME))