summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-07-20 12:58:04 +0200
committerHarald Welte <laforge@gnumonks.org>2010-07-20 12:58:04 +0200
commit19f4897e34bdd2f951466faf1265bac9ef8f0db7 (patch)
tree303cc9a385c12fecd8dd878290feedda89ec8505
parentfa4f469558a15b616d5e96858da73d59e1a2e9e0 (diff)
fix more memory leaks regarding OBJECT_IDENTIFIER and ANY types
-rw-r--r--src/csl_dha.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/csl_dha.c b/src/csl_dha.c
index e335ade..3d7234a 100644
--- a/src/csl_dha.c
+++ b/src/csl_dha.c
@@ -104,6 +104,9 @@ int tcap_csl_tc_uni_req(struct tcap_dialogue *td, OBJECT_IDENTIFIER_t *app_ctx,
ANY_fromType(any, &asn_DEF_ExternalPDU, ext);
tcm->choice.unidirectional.dialoguePortion = (OCTET_STRING_t *) any;
+
+ asn_DEF_OBJECT_IDENTIFIER.free_struct(&asn_DEF_OBJECT_IDENTIFIER, app_ctx, 0);
+ asn_DEF_ANY.free_struct(&asn_DEF_ANY, &ext->dialog, 1);
}
/* Request components to CHA */
pend_comp = tcap_cha_req_components(td);
@@ -163,6 +166,9 @@ int tcap_csl_tc_begin_req(struct tcap_dialogue *td, OBJECT_IDENTIFIER_t *app_ctx
ANY_fromType(any, &asn_DEF_ExternalPDU, ext);
tcm->choice.begin.dialoguePortion = (OCTET_STRING_t *) any;
+
+ asn_DEF_OBJECT_IDENTIFIER.free_struct(&asn_DEF_OBJECT_IDENTIFIER, app_ctx, 0);
+ asn_DEF_ANY.free_struct(&asn_DEF_ANY, &ext->dialog, 1);
}
/* Request components to CHA */
/* Process components */
@@ -336,10 +342,12 @@ static ANY_t *gen_ext_AARE(struct tcap_dialogue *td, OBJECT_IDENTIFIER_t *app_ct
/* Link Dialogue into External PDU */
printf("calling ANY_fromType(%p, %p, %p)\n", &ext->dialog, &asn_DEF_DialoguePDU, dial);
rc = ANY_fromType((ANY_t *) &ext->dialog, &asn_DEF_DialoguePDU, dial);
+ asn_DEF_OBJECT_IDENTIFIER.free_struct(&asn_DEF_OBJECT_IDENTIFIER, app_ctx, 0);
if (rc < 0) {
fprintf(stderr, "Error generating ExternalPDU from DialoguePDU\n");
return NULL;
}
+ asn_DEF_ANY.free_struct(&asn_DEF_ANY, &ext->dialog, 1);
/* Link External PDU into Dialogue Portion */
rc = ANY_fromType(any, &asn_DEF_ExternalPDU, ext);
if (rc < 0) {
@@ -399,7 +407,7 @@ int tcap_csl_tc_cont_req(struct tcap_dialogue *td, OBJECT_IDENTIFIER_t *app_ctx,
tcap_trans_set_state(&td->trans, TCAP_TS_ACTIVE);
- asn_DEF_ANY.free_struct(&asn_DEF_ANY, any, 0);
+ asn_DEF_TCMessage.free_struct(&asn_DEF_TCMessage, &tcm, 1);
return rc;
}
@@ -457,7 +465,8 @@ int tcap_csl_tc_end_req(struct tcap_dialogue *td, OBJECT_IDENTIFIER_t *app_ctx,
/* TR-END.req to TSL */
rc = tcap_tco_tr_end_req(&td->trans, &tcm);
- asn_DEF_ANY.free_struct(&asn_DEF_ANY, any, 0);
+ asn_DEF_TCMessage.free_struct(&asn_DEF_TCMessage, &tcm, 1);
+
/* Dialogue terminated to CHA */
tcap_cha_dialg_term(td);
/* Free Dialogue ID */