mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Merge pull request #235 from pi-hole/fix/wildcarddomains_not_NULL
Test for wildcarddomains == NULL in flush.c
This commit is contained in:
@@ -54,13 +54,17 @@ void pihole_log_flushed(bool message)
|
||||
memory.domainnames = 0;
|
||||
|
||||
// wildcarddomains struct: Free allocated substructure
|
||||
for(i=0;i<counters.wildcarddomains;i++)
|
||||
// Do this only when we actually imported wildcards
|
||||
if(wildcarddomains != NULL)
|
||||
{
|
||||
free(wildcarddomains[i]);
|
||||
for(i=0;i<counters.wildcarddomains;i++)
|
||||
{
|
||||
free(wildcarddomains[i]);
|
||||
}
|
||||
free(wildcarddomains);
|
||||
wildcarddomains = NULL;
|
||||
memory.wildcarddomains = 0;
|
||||
}
|
||||
free(wildcarddomains);
|
||||
wildcarddomains = NULL;
|
||||
memory.wildcarddomains = 0;
|
||||
|
||||
// overTime struct: Free allocated substructure
|
||||
for(i=0;i<counters.overTime;i++)
|
||||
|
||||
@@ -238,6 +238,12 @@ load 'libs/bats-support/load'
|
||||
[[ ${lines[2]} == "d2 ff ff ff ff d2 00 00 00 07 d2 00 00 00 02 ca 41 e4 92 49 d2 00 00 00 06 d2 00 00 00 03 d2 00 00 00 02 d2 00 00 00 03 d2 00 00 00 03 cc 02 c1 " ]]
|
||||
}
|
||||
|
||||
@test "Verify no FATAL warnings are present in the generated log" {
|
||||
run bash -c 'grep -c "FATAL" pihole-FTL.log'
|
||||
echo "output: ${lines[@]}"
|
||||
[[ ${lines[0]} == "0" ]]
|
||||
}
|
||||
|
||||
@test "Final part of the tests: Killing pihole-FTL process" {
|
||||
run bash -c 'echo ">kill" | nc -v 127.0.0.1 4711'
|
||||
echo "output: ${lines[@]}"
|
||||
|
||||
Reference in New Issue
Block a user