Skip to content

Commit

Permalink
fix rpc_mdns_query_ptr api's result_total parameter exception value w…
Browse files Browse the repository at this point in the history
…hen scan failed
  • Loading branch information
lyzsuper committed Nov 30, 2020
1 parent 1e0ddc7 commit 0f05e4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/wifi/wifi_mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ int32_t rpc_mdns_query_a(const char * host_name, uint32_t timeout, binary_t * ad
printf("rpc_mdns_query_ptr_result malloc failed \r\n");
}

result_addr->addr = 0;

ret = mdns_query_a(host_name,timeout,result_addr);

addr->data = result_addr;
Expand All @@ -168,6 +170,8 @@ int32_t rpc_mdns_query_ptr(const char * service_type, const char * proto, uint32
esp_err_t ret = ESP_FAIL;
int count = 0;

*result_total = 0;

mdns_query_results_free(results);
ret = mdns_query_ptr(service_type,proto,timeout,max_results,&results);
if(!ret && results){
Expand Down

0 comments on commit 0f05e4b

Please sign in to comment.