fix leaking DNS suffix search list on Windows (#711)

ares__strsplit provides a newly allocated buffer, so suffix list in
line variable isn't referenced anymore. Related ares_free seems to
have gone missing during refactoring made in #594

Fix By: Vojtěch Vobr (@vojtechvobr)
pull/712/head
Vojtěch Vobr 9 months ago committed by GitHub
parent fed3559cfc
commit a1008eead2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      src/lib/ares_sysconfig.c

@ -624,6 +624,7 @@ static ares_status_t ares__init_sysconfig_windows(ares_sysconfig_t *sysconfig)
if (get_SuffixList_Windows(&line)) { if (get_SuffixList_Windows(&line)) {
sysconfig->domains = ares__strsplit(line, ", ", &sysconfig->ndomains); sysconfig->domains = ares__strsplit(line, ", ", &sysconfig->ndomains);
ares_free(line);
if (sysconfig->domains == NULL) { if (sysconfig->domains == NULL) {
status = ARES_EFILE; status = ARES_EFILE;
} }

Loading…
Cancel
Save