dns_client: fix crash issue.

This commit is contained in:
Nick Peng
2023-03-31 20:26:50 +08:00
parent 582cdfb879
commit d402d62cc5
2 changed files with 69 additions and 1 deletions

View File

@@ -3444,7 +3444,7 @@ static int _dns_client_send_packet(struct dns_query_struct *query, void *packet,
}
int num = atomic_dec_return(&query->dns_request_sent);
if (num == 0) {
if (num == 0 && send_count > 0) {
_dns_client_query_remove(query);
}