Commit 2b7727aa authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

James Bursa's patch to avoid free(NULL) (mainly because the libcurl memdebug

system thinks free(NULL) is badness)
parent fd775454
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -101,13 +101,13 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
      /* Something failed; clean up memory we may have allocated. */
      if (channel->nservers != -1)
	free(channel->servers);
      if (channel->ndomains != -1)
      if (channel->domains)
	{
	  for (i = 0; i < channel->ndomains; i++)
	    free(channel->domains[i]);
	  free(channel->domains);
	}
      if (channel->nsort != -1)
      if (channel->sortlist)
	free(channel->sortlist);
      if(channel->lookups)
        free(channel->lookups);
@@ -454,6 +454,7 @@ DhcpNameServer
      if (status != ARES_SUCCESS)
        break;
    }
    if(line)
      free(line);
    fclose(fp);
  }