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.
This commit is contained in:
Holger Hans Peter Freyther 2013-08-13 14:48:44 +02:00
parent 8c1c28bdef
commit deff65a9de
1 changed files with 1 additions and 0 deletions

View File

@ -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))