free() allocated memory when the ares search can't be made
authorDaniel Stenberg <daniel@haxx.se>
Thu, 27 May 2004 07:10:36 +0000 (07:10 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 27 May 2004 07:10:36 +0000 (07:10 +0000)
ares/ares_search.c

index dab4236..96a2f1f 100644 (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);
+      }
     }
 }