Skip to content

Commit

Permalink
Merge pull request #2010 from pi-hole/fix/rev-servers-crash
Browse files Browse the repository at this point in the history
Fix rev-server crash
  • Loading branch information
yubiuser authored Jul 15, 2024
2 parents c9cfd38 + 87dd091 commit f12d14f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/config/dnsmasq_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,12 @@ bool __attribute__((const)) write_dnsmasq_config(struct config *conf, bool test_
{
log_warn("New dnsmasq configuration is not valid (%s), config remains unchanged", errbuf);

if(debug_flags[DEBUG_ANY])
{
log_debug(DEBUG_ANY, "Temporary dnsmasq config file left in place for debugging purposes");
return false;
}

// Remove temporary config file
if(remove(DNSMASQ_TEMP_CONF) != 0)
{
Expand Down
9 changes: 4 additions & 5 deletions src/dnsmasq/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,10 +1193,10 @@ static char *domain_rev4(int from_file, char *server, struct in_addr *addr4, int
return _("error");
}

if (sdetails.orig_hostinfo)
freeaddrinfo(sdetails.orig_hostinfo);
}
}
if (sdetails.orig_hostinfo)
freeaddrinfo(sdetails.orig_hostinfo);

return NULL;
}
Expand Down Expand Up @@ -1280,11 +1280,10 @@ static char *domain_rev6(int from_file, char *server, struct in6_addr *addr6, in
if (!add_update_server(flags, &serv_addr, &source_addr, interface, domain, NULL))
return _("error");
}

if (sdetails.orig_hostinfo)
freeaddrinfo(sdetails.orig_hostinfo);
}
}
if (sdetails.orig_hostinfo)
freeaddrinfo(sdetails.orig_hostinfo);

return NULL;
}
Expand Down

0 comments on commit f12d14f

Please sign in to comment.