pespin has uploaded this change for review.

View Change

ranap: Fix msgb leak on decode error paths

Change-Id: I58ef8f227d177dc1e99d2c342dd7d5fd6e5b3747
---
M src/iu_client.c
1 file changed, 4 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/21/43321/1
diff --git a/src/iu_client.c b/src/iu_client.c
index 993a0e0..8df8c7d 100644
--- a/src/iu_client.c
+++ b/src/iu_client.c
@@ -461,6 +461,7 @@

if (ranap_parse_lai(&ra_id, &ies->lai) != 0) {
LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n");
+ msgb_free(msg);
return -1;
}

@@ -469,6 +470,7 @@
if (ra_id.rac == OSMO_RESERVED_RAC) {
LOGPIU(LOGL_ERROR,
"Rejecting RNC with invalid/internally used RAC 0x%02x\n", ra_id.rac);
+ msgb_free(msg);
return -1;
}
} else {
@@ -478,6 +480,7 @@
if (iu_grnc_id_parse(&rnc_id, &ies->globalRNC_ID) != 0) {
LOGPIU(LOGL_ERROR,
"Failed to parse RANAP Global-RNC-ID IE\n");
+ msgb_free(msg);
return -1;
}

@@ -518,6 +521,7 @@
if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) {
if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) {
LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n");
+ msgb_free(msg);
return -1;
}
ra_id = &_ra_id;

To view, visit change 43321. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I58ef8f227d177dc1e99d2c342dd7d5fd6e5b3747
Gerrit-Change-Number: 43321
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>