diff options
| author | wangmenglan <[email protected]> | 2024-11-12 15:19:14 +0800 |
|---|---|---|
| committer | wangmenglan <[email protected]> | 2024-11-12 15:19:14 +0800 |
| commit | 1620b6932913d2b2dba7baf13dcb92b7ee7fba91 (patch) | |
| tree | 560456ebd04d224d8e76baa42e22d925426e9aa6 | |
| parent | 9eb87f2a15c647baf980e549ddd6cb1dc64faaaa (diff) | |
bugfix: memory leak
| -rw-r--r-- | common/src/tfe_ctrl_packet.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/src/tfe_ctrl_packet.cpp b/common/src/tfe_ctrl_packet.cpp index 44dd337..94f4ba5 100644 --- a/common/src/tfe_ctrl_packet.cpp +++ b/common/src/tfe_ctrl_packet.cpp @@ -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; } |
