From 27876a2df0c76ab43f528f21d942d4461dc3a759 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 13 Aug 2013 14:48:44 +0200 Subject: 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. --- openbsc/src/osmo-bsc_nat/bsc_ussd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'openbsc') diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c index e0c5c6dda..f7753fb49 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)) -- cgit v1.2.3