mirror of https://github.com/ARMmbed/mbed-os.git
TEST_APPS socket_app leaks memory when cannot initialize packetSizes
parent
e441f1f99d
commit
05b1f44492
|
@ -673,6 +673,7 @@ static nsapi_size_or_error_t start_udp_receiver_thread(SInfo *info, int argc, ch
|
||||||
int *packetSizes = new (nothrow) int[PACKET_SIZE_ARRAY_LEN];
|
int *packetSizes = new (nothrow) int[PACKET_SIZE_ARRAY_LEN];
|
||||||
if (!packetSizes) {
|
if (!packetSizes) {
|
||||||
cmd_printf("Allocation failed\r\n");
|
cmd_printf("Allocation failed\r\n");
|
||||||
|
free(dataIn);
|
||||||
return CMDLINE_RETCODE_FAIL;
|
return CMDLINE_RETCODE_FAIL;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < PACKET_SIZE_ARRAY_LEN; i++) {
|
for (int i = 0; i < PACKET_SIZE_ARRAY_LEN; i++) {
|
||||||
|
|
Loading…
Reference in New Issue