Free ies struct after use in tests and hnbgw_cn/rua
diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c
index 18661ea..d8824ea 100644
--- a/src/hnbgw_cn.c
+++ b/src/hnbgw_cn.c
@@ -102,6 +102,8 @@
rc = ranap_decode_reseties(&ies, &imsg->value);
/* FIXME: reset resources and return reset ack */
+
+ ranap_free_reseties(&ies);
return rc;
}
@@ -115,6 +117,7 @@
hnbgw_cnlink_change_state(cnlink, CNLINK_S_EST_ACTIVE);
+ ranap_free_resetacknowledgeies(&ies);
return rc;
}
@@ -134,6 +137,8 @@
llist_for_each_entry(hnb, &gw->hnb_list, list) {
rc = rua_tx_udt(hnb, data, len);
}
+
+ ranap_free_pagingies(&ies);
return 0;
}
diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index 4059cf8..a6f0100 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -301,6 +301,7 @@
default:
LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n",
ies.cN_DomainIndicator);
+ rua_free_connecties(&ies);
return -1;
}
@@ -312,6 +313,7 @@
context_id, 0, ies.ranaP_Message.buf,
ies.ranaP_Message.size);
/* FIXME: what to do with the asn1c-allocated memory */
+ rua_free_connecties(&ies);
return rc;
}
@@ -355,6 +357,7 @@
rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DISCONNECT,
context_id, scu_cause, ranap_data, ranap_len);
/* FIXME: what to do with the asn1c-allocated memory */
+ rua_free_disconnecties(&ies);
return rc;
}
@@ -389,6 +392,7 @@
context_id, 0, ies.ranaP_Message.buf,
ies.ranaP_Message.size);
/* FIXME: what to do with the asn1c-allocated memory */
+ rua_free_directtransferies(&ies);
return rc;
@@ -414,6 +418,7 @@
* can ignore. In either case, it is RANAP that we need to
* decode... */
rc = hnbgw_ranap_rx(msg, ies.ranaP_Message.buf, ies.ranaP_Message.size);
+ rua_free_connectionlesstransferies(&ies);
return rc;
}
@@ -431,6 +436,7 @@
LOGP(DRUA, LOGL_ERROR, "RUA UData.ErrorInd(%s)\n",
rua_cause_str(&ies.cause));
+ rua_free_errorindicationies(&ies);
return rc;
}
diff --git a/src/tests/hnb-test.c b/src/tests/hnb-test.c
index e2fa2ed..35700c2 100644
--- a/src/tests/hnb-test.c
+++ b/src/tests/hnb-test.c
@@ -140,6 +140,7 @@
hnb->rnc_id = accept.rnc_id;
printf("HNB Register accept with RNC ID %u\n", hnb->rnc_id);
+ hnbap_free_hnbregisteraccepties(&accept);
return 0;
}
@@ -167,6 +168,7 @@
printf("UE Register accept for IMSI %s, context %u\n", imsi, ctx_id);
hnb->ctx_id = ctx_id;
+ hnbap_free_ueregisteraccepties(&accept);
return 0;
}
diff --git a/src/tests/test-hnbap.c b/src/tests/test-hnbap.c
index 463b4d4..c6e7d94 100644
--- a/src/tests/test-hnbap.c
+++ b/src/tests/test-hnbap.c
@@ -120,6 +120,8 @@
ASSERT(!strcmp((char *) hnb_ies.hnB_Identity.hNB_Identity_Info.buf, "10005B9-0010942050@"));
printf("HNBAP register request for HNB %s\n", (char *) hnb_ies.hnB_Identity.hNB_Identity_Info.buf);
+ hnbap_free_hnbregisterrequesties(&hnb_ies);
+
dec_ret = aper_decode(NULL, &asn_DEF_HNBAP_PDU, (void **) &pdu,
hnbap_ue_reg_req, sizeof(hnbap_ue_reg_req), 0, 0);
@@ -138,6 +140,7 @@
ue_req_ies.uE_Identity.choice.iMSI.size);
printf("HNBAP UE Register request from IMSI %s\n", imsi);
+ hnbap_free_ueregisterrequesties(&ue_req_ies);
memset(pdu, 0, sizeof(*pdu));
dec_ret = aper_decode(NULL, &asn_DEF_HNBAP_PDU, (void **) &pdu,
@@ -158,6 +161,7 @@
ue_acc_ies.uE_Identity.choice.iMSI.size);
printf("HNBAP UE Register accept to IMSI %s\n", imsi);
+ hnbap_free_ueregisteraccepties(&ue_acc_ies);
}