don't double-free msgb's in rua_helper and ranap_common_cn
This commit is contained in:
parent
3aad6af6a4
commit
cee5a2878b
|
@ -27,8 +27,9 @@
|
||||||
|
|
||||||
#include "ranap_common.h"
|
#include "ranap_common.h"
|
||||||
#include "ranap_ies_defs.h"
|
#include "ranap_ies_defs.h"
|
||||||
|
#include "ranap_common_cn.h"
|
||||||
|
|
||||||
#include "cn_ranap_common.h"
|
#include "hnbgw.h"
|
||||||
|
|
||||||
static int cn_ranap_rx_initiating_msg_co(void *ctx, RANAP_InitiatingMessage_t *imsg,
|
static int cn_ranap_rx_initiating_msg_co(void *ctx, RANAP_InitiatingMessage_t *imsg,
|
||||||
ranap_message *message)
|
ranap_message *message)
|
||||||
|
@ -148,7 +149,6 @@ int cn_ranap_rx_co(void *ctx, uint8_t *data, size_t len)
|
||||||
|
|
||||||
memset(&message, 0, sizeof(message));
|
memset(&message, 0, sizeof(message));
|
||||||
|
|
||||||
memset(pdu, 0, sizeof(*pdu));
|
|
||||||
dec_ret = aper_decode(NULL,&asn_DEF_RANAP_RANAP_PDU, (void **) &pdu,
|
dec_ret = aper_decode(NULL,&asn_DEF_RANAP_RANAP_PDU, (void **) &pdu,
|
||||||
data, len, 0, 0);
|
data, len, 0, 0);
|
||||||
if (dec_ret.code != RC_OK) {
|
if (dec_ret.code != RC_OK) {
|
||||||
|
@ -282,7 +282,6 @@ int cn_ranap_rx_cl(void *ctx, uint8_t *data, size_t len)
|
||||||
|
|
||||||
memset(&message, 0, sizeof(message));
|
memset(&message, 0, sizeof(message));
|
||||||
|
|
||||||
memset(pdu, 0, sizeof(*pdu));
|
|
||||||
dec_ret = aper_decode(NULL,&asn_DEF_RANAP_RANAP_PDU, (void **) &pdu,
|
dec_ret = aper_decode(NULL,&asn_DEF_RANAP_RANAP_PDU, (void **) &pdu,
|
||||||
data, len, 0, 0);
|
data, len, 0, 0);
|
||||||
if (dec_ret.code != RC_OK) {
|
if (dec_ret.code != RC_OK) {
|
||||||
|
|
|
@ -58,8 +58,6 @@ struct msgb *rua_new_conn(int is_ps, uint32_t context_id, struct msgb *inmsg)
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
msgb_free(inmsg);
|
|
||||||
|
|
||||||
msg = rua_generate_initiating_message(RUA_ProcedureCode_id_Connect,
|
msg = rua_generate_initiating_message(RUA_ProcedureCode_id_Connect,
|
||||||
RUA_Criticality_reject,
|
RUA_Criticality_reject,
|
||||||
&asn_DEF_RUA_Connect,
|
&asn_DEF_RUA_Connect,
|
||||||
|
@ -96,8 +94,6 @@ struct msgb *rua_new_dt(int is_ps, uint32_t context_id, struct msgb *inmsg)
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
msgb_free(inmsg);
|
|
||||||
|
|
||||||
msg = rua_generate_initiating_message(RUA_ProcedureCode_id_DirectTransfer,
|
msg = rua_generate_initiating_message(RUA_ProcedureCode_id_DirectTransfer,
|
||||||
RUA_Criticality_reject,
|
RUA_Criticality_reject,
|
||||||
&asn_DEF_RUA_DirectTransfer,
|
&asn_DEF_RUA_DirectTransfer,
|
||||||
|
@ -132,16 +128,14 @@ struct msgb *rua_new_disc(int is_ps, uint32_t context_id, struct msgb *inmsg)
|
||||||
if (inmsg && inmsg->data&& msgb_length(inmsg)) {
|
if (inmsg && inmsg->data&& msgb_length(inmsg)) {
|
||||||
ies.presenceMask |= DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT;
|
ies.presenceMask |= DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT;
|
||||||
OCTET_STRING_fromBuf(&ies.ranaP_Message.buf, inmsg->data, msgb_length(inmsg));
|
OCTET_STRING_fromBuf(&ies.ranaP_Message.buf, inmsg->data, msgb_length(inmsg));
|
||||||
msgb_free(inmsg);
|
|
||||||
}
|
}
|
||||||
|
msgb_free(inmsg);
|
||||||
|
|
||||||
memset(&out, 0, sizeof(out));
|
memset(&out, 0, sizeof(out));
|
||||||
rc = rua_encode_disconnecties(&out, &ies);
|
rc = rua_encode_disconnecties(&out, &ies);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
msgb_free(inmsg);
|
|
||||||
|
|
||||||
msg = rua_generate_initiating_message(RUA_ProcedureCode_id_Disconnect,
|
msg = rua_generate_initiating_message(RUA_ProcedureCode_id_Disconnect,
|
||||||
RUA_Criticality_reject,
|
RUA_Criticality_reject,
|
||||||
&asn_DEF_RUA_Disconnect,
|
&asn_DEF_RUA_Disconnect,
|
||||||
|
|
Loading…
Reference in New Issue