diff --git a/ares/ares_search.c b/ares/ares_search.c index dab42368a..96a2f1f91 100644 --- a/ares/ares_search.c +++ b/ares/ares_search.c @@ -124,7 +124,12 @@ void ares_search(ares_channel channel, const char *name, int dnsclass, free(s); } else + { + /* failed, free the malloc()ed memory */ + free(squery->name); + free(squery); callback(arg, status, NULL, 0); + } } }