Skip to content

Commit d26dc88

Browse files
authored
TEST_APPS socket_app leaks memory when cannot initialize packetSizes
1 parent a87c7c8 commit d26dc88

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

TEST_APPS/device/socket_app/cmd_socket.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ static nsapi_size_or_error_t start_udp_receiver_thread(SInfo *info, int argc, ch
673673
int *packetSizes = new (nothrow) int[PACKET_SIZE_ARRAY_LEN];
674674
if (!packetSizes) {
675675
cmd_printf("Allocation failed\r\n");
676+
free(dataIn);
676677
return CMDLINE_RETCODE_FAIL;
677678
}
678679
for (int i = 0; i < PACKET_SIZE_ARRAY_LEN; i++) {

0 commit comments

Comments
 (0)