Skip to content

Commit

Permalink
issue esp8266#4893
Browse files Browse the repository at this point in the history
cleared the linkedlist.
  • Loading branch information
a-c-sreedhar-reddy authored Jul 6, 2018
1 parent d04f5c9 commit da0d55f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions libraries/ESP8266mDNS/ESP8266mDNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,12 @@ int MDNSResponder::queryService(char *service, char *proto) {
#ifdef DEBUG_ESP_MDNS_TX
DEBUG_ESP_PORT.printf("queryService %s %s\n", service, proto);
#endif
MDNSAnswer *answer;
int numAnswers = _getNumAnswers();
for (int n = numAnswers - 1; n >= 0; n--) {
answer = _getAnswerFromIdx(n);
os_free(answer->hostname);
os_free(answer);
answer = 0;
while(_answers!=0){
MDNSAnswer *currAnswer = _answers;
_answers = _answers->next;
os_free(currAnswer->hostname);
os_free(currAnswer);
currAnswer = 0;
}
_answers = 0;
if (_query != 0) {
Expand Down

0 comments on commit da0d55f

Please sign in to comment.