currectly freed the memory for the evrsrm

This commit is contained in:
gilteixeira 2023-04-15 16:31:01 +01:00
parent 2d5b779ae4
commit 9dab57bc2a
1 changed files with 7 additions and 3 deletions

View File

@ -212,6 +212,7 @@ cleanup:
}
static int evrsrm_pre_reservation_response(uint8_t *evrsrm_oer, uint32_t *evrsrm_len) {
int rv = 0;
EV_RSR_t *evrsr_response = calloc(1, sizeof(EV_RSR_t));
evrsr_response->header.protocolVersion = 1;
evrsr_response->header.messageID = 1;
@ -236,11 +237,14 @@ static int evrsrm_pre_reservation_response(uint8_t *evrsrm_oer, uint32_t *evrsrm
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EV_RSR, NULL, evrsr_response, evrsrm_oer, 512);
if (enc.encoded == -1) {
log_error("[ca] failed encoding evrsrm (%s)", enc.failed_type->name);
return 1;
rv = 1;
goto cleanup;
}
*evrsrm_len = (enc.encoded + 7) / 8;
pre_reservation_id++;
return 0;
cleanup:
ASN_STRUCT_FREE(asn_DEF_EV_RSR, evrsr_response);
return rv;
}
int evcsnm_check(EvcsnPdu_t *evcsnm) {