mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
abis_rsl_rcvmsg(): Fix msgb memory leak in error path
Thanks to Andreas Eversberg for spotting this one.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user