Skip to content

Commit c7c4819

Browse files
authored
Merge pull request #11400 from anttiylitokola/dns_cleanup_fix
nsapi_dns: cleanup dns queue when running out or memory
2 parents 525d3cc + 1708ec2 commit c7c4819

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

features/netsocket/nsapi_dns.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ nsapi_value_or_error_t nsapi_dns_query_multiple_async(NetworkStack *stack, const
726726
if (nsapi_dns_call_in(query->call_in_cb, DNS_TIMER_TIMEOUT, mbed::callback(nsapi_dns_query_async_timeout)) != NSAPI_ERROR_OK) {
727727
delete[] query->host;
728728
delete query;
729+
dns_query_queue[index] = NULL;
729730
dns_mutex->unlock();
730731
return NSAPI_ERROR_NO_MEMORY;
731732
}

0 commit comments

Comments
 (0)