Skip to content

Commit

Permalink
clear mdns.queryservice()'s previous result when called (#4894)
Browse files Browse the repository at this point in the history
cleared the linkedlist.
* issue #4893
  • Loading branch information
a-c-sreedhar-reddy authored and devyte committed Jul 6, 2018
1 parent 12d5222 commit e0b6242
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/ESP8266mDNS/ESP8266mDNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,13 @@ int MDNSResponder::queryService(char *service, char *proto) {
#ifdef DEBUG_ESP_MDNS_TX
DEBUG_ESP_PORT.printf("queryService %s %s\n", service, proto);
#endif

while(_answers!=0){
MDNSAnswer *currAnswer = _answers;
_answers = _answers->next;
os_free(currAnswer->hostname);
os_free(currAnswer);
currAnswer = 0;
}
if (_query != 0) {
os_free(_query);
_query = 0;
Expand Down

0 comments on commit e0b6242

Please sign in to comment.