pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/43321?usp=email )

Change subject: ranap: Fix msgb leak on decode error paths
......................................................................

ranap: Fix msgb leak on decode error paths

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

Approvals:
  osmith: Looks good to me, approved
  Jenkins Builder: Verified




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 https://gerrit.osmocom.org/c/osmo-iuh/+/43321?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I58ef8f227d177dc1e99d2c342dd7d5fd6e5b3747
Gerrit-Change-Number: 43321
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to