bugfix: memory leak

This commit is contained in:
wangmenglan
2024-11-12 15:19:14 +08:00
parent 9eb87f2a15
commit 1620b69329

View File

@@ -190,11 +190,14 @@ static int tags_ids_array_parse_mpack(struct ctrl_pkt_parser *handler, mpack_nod
if (mpack_parse_uuid(mpack_node_array_at(node, i), tags_ids[i]) != 0)
{
TFE_LOG_ERROR(g_packet_io_logger, "%s: session %lu unexpected control packet: (%s[%d] len != uuid_t[%d])", LOG_TAG_CTRLPKT, handler->session_id, tags_ids_cmsg_name_maps[map_index], i, UUID_LEN);
return -1;
goto end;
}
}
tfe_cmsg_set(handler->cmsg, (enum tfe_cmsg_tlv_type)tags_ids_cmsg_maps[map_index], (const unsigned char*)tags_ids, tags_ids_len);
end:
if (tags_ids)
free(tags_ids);
return 0;
}