diff --git a/src/tpm.c b/src/tpm.c index b92ba16..bd439a5 100644 --- a/src/tpm.c +++ b/src/tpm.c @@ -141,6 +141,8 @@ int tpm_pay(void* fc, tolling_info_t* info, void* security_socket, uint8_t* neig asn_enc_rval_t e_tep = uper_encode_to_buffer(&asn_DEF_TPM, NULL, tolling->station.obu.entry_proof, b_tep, 1024); if (e_tep.encoded == -1) { syslog_err("[facilities] [tolling] error encoding TPM entry proof (%s)", e_tep.failed_type->name); + ASN_STRUCT_FREE(asn_DEF_TPM, tolling->station.obu.entry_proof); + tolling->station.obu.entry_proof = NULL; rv = 1; goto cleanup; }