free() allocated memory when the ares search can't be made

This commit is contained in:
Daniel Stenberg 2004-05-27 07:10:36 +00:00
parent a5360255ba
commit c2e8ba0fba

View File

@ -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);
}
}
}