From 253a7b67463a358989b80aa9f2d7db1b8a493bda Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Mon, 29 Jul 2024 12:09:41 +0300 Subject: [PATCH] [fixup] memory handling --- src/ca.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ca.c b/src/ca.c index 33651a3243..e680be09d2 100644 --- a/src/ca.c +++ b/src/ca.c @@ -1886,7 +1886,7 @@ static int CIPLUS_APP_OPRF_handler(ca_session_t *session, int tag, int info_valid = (data[0] & (1 << 3)) > 0; int info_version = data[0] & 0x07; int cicam_original_network_id = (data[1] << 8) + data[2]; - char lang_code[4]; + char lang_code[4] = {0}; strncpy(lang_code, (char *)data + 10, 3); char *profile_name = _malloc(data[13]); strncpy(profile_name, (char *)data + 14, data[13]); @@ -1903,6 +1903,7 @@ static int CIPLUS_APP_OPRF_handler(ca_session_t *session, int tag, // Initiate a profile search ca_write_apdu(session, CIPLUS_TAG_OPERATOR_SEARCH_START, data_oprf_search, sizeof(data_oprf_search)); + _free(profile_name); break; } case CIPLUS_TAG_OPERATOR_TUNE: {