Skip to content

Commit f12d14f

Browse files
authored
Merge pull request #2010 from pi-hole/fix/rev-servers-crash
Fix rev-server crash
2 parents c9cfd38 + 87dd091 commit f12d14f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/config/dnsmasq_config.c

+6
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,12 @@ bool __attribute__((const)) write_dnsmasq_config(struct config *conf, bool test_
732732
{
733733
log_warn("New dnsmasq configuration is not valid (%s), config remains unchanged", errbuf);
734734

735+
if(debug_flags[DEBUG_ANY])
736+
{
737+
log_debug(DEBUG_ANY, "Temporary dnsmasq config file left in place for debugging purposes");
738+
return false;
739+
}
740+
735741
// Remove temporary config file
736742
if(remove(DNSMASQ_TEMP_CONF) != 0)
737743
{

src/dnsmasq/option.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -1193,10 +1193,10 @@ static char *domain_rev4(int from_file, char *server, struct in_addr *addr4, int
11931193
return _("error");
11941194
}
11951195

1196-
if (sdetails.orig_hostinfo)
1197-
freeaddrinfo(sdetails.orig_hostinfo);
11981196
}
11991197
}
1198+
if (sdetails.orig_hostinfo)
1199+
freeaddrinfo(sdetails.orig_hostinfo);
12001200

12011201
return NULL;
12021202
}
@@ -1280,11 +1280,10 @@ static char *domain_rev6(int from_file, char *server, struct in6_addr *addr6, in
12801280
if (!add_update_server(flags, &serv_addr, &source_addr, interface, domain, NULL))
12811281
return _("error");
12821282
}
1283-
1284-
if (sdetails.orig_hostinfo)
1285-
freeaddrinfo(sdetails.orig_hostinfo);
12861283
}
12871284
}
1285+
if (sdetails.orig_hostinfo)
1286+
freeaddrinfo(sdetails.orig_hostinfo);
12881287

12891288
return NULL;
12901289
}

0 commit comments

Comments
 (0)