Permalink
Browse files

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

  • Loading branch information...
bagder committed May 27, 2004
1 parent 76f5209 commit 080f8f4cd464e1020019527709c3621565967e8e
Showing with 5 additions and 0 deletions.
  1. +5 −0 ares_search.c
View
@@ -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);
+ }
}
}

0 comments on commit 080f8f4

Please sign in to comment.