neels has uploaded this change for review.

View Change

fix memleak in ran_decode: free after aper_decode() on error

Same fix as recently [1] applied to
ranap_cn_rx_co_decode()
now also applied to
ranap_ran_rx_co_decode()

[1]
48e1f1833ff06088c875157cc912dc25c5a01c29
I03ed2376e520ec6dbcc2bae22f9291e211c7cca9

Change-Id: Idd1d10c523eddcf6d0c1d54346982d6ef6fc3799
---
M src/ranap_common_ran.c
1 file changed, 3 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/33/38333/1
diff --git a/src/ranap_common_ran.c b/src/ranap_common_ran.c
index 048a5df..828587e 100644
--- a/src/ranap_common_ran.c
+++ b/src/ranap_common_ran.c
@@ -300,13 +300,15 @@
dec_ret = aper_decode(NULL, &asn_DEF_RANAP_RANAP_PDU, (void **)&pdu, data, len, 0, 0);
if (dec_ret.code != RC_OK) {
LOGP(DRANAP, LOGL_ERROR, "Error in RANAP ASN.1 decode\n");
- return -1;
+ rc = -1;
+ goto error_free;
}

message->direction = pdu->present;

rc = _ran_ranap_rx_co(ctx, pdu, message);

+error_free:
ASN_STRUCT_FREE(asn_DEF_RANAP_RANAP_PDU, pdu);

return rc;

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

Gerrit-MessageType: newchange
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Idd1d10c523eddcf6d0c1d54346982d6ef6fc3799
Gerrit-Change-Number: 38333
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>