abis_rsl_rcvmsg(): Fix msgb memory leak in error path

Thanks to Andreas Eversberg for spotting this one.
This commit is contained in:
Harald Welte 2012-05-31 20:22:34 +02:00
parent c513ded578
commit f25b55ec71
1 changed files with 2 additions and 1 deletions

View File

@ -1907,6 +1907,7 @@ int abis_rsl_rcvmsg(struct msgb *msg)
if (msgb_l2len(msg) < sizeof(*rslh)) {
DEBUGP(DRSL, "Truncated RSL message with l2len: %u\n", msgb_l2len(msg));
msgb_free(msg);
return -1;
}
@ -1935,7 +1936,7 @@ int abis_rsl_rcvmsg(struct msgb *msg)
default:
LOGP(DRSL, LOGL_NOTICE, "unknown RSL message discriminator "
"0x%02x\n", rslh->msg_discr);
return -EINVAL;
rc = -EINVAL;
}
msgb_free(msg);
return rc;