diff --git a/nfq/nfqws.c b/nfq/nfqws.c index d0430f2..9d2c0e9 100644 --- a/nfq/nfqws.c +++ b/nfq/nfqws.c @@ -126,14 +126,14 @@ static bool test_list_files() struct ipset_file *ifile; LIST_FOREACH(hfile, ¶ms.hostlists, next) - if (!file_open_test(hfile->filename, O_RDONLY)) + if (hfile->filename && !file_open_test(hfile->filename, O_RDONLY)) { DLOG_PERROR("file_open_test"); DLOG_ERR("cannot access hostlist file '%s'\n",hfile->filename); return false; } LIST_FOREACH(ifile, ¶ms.ipsets, next) - if (!file_open_test(ifile->filename, O_RDONLY)) + if (hfile->filename && !file_open_test(ifile->filename, O_RDONLY)) { DLOG_PERROR("file_open_test"); DLOG_ERR("cannot access ipset file '%s'\n",ifile->filename); diff --git a/tpws/tpws.c b/tpws/tpws.c index 24596c5..ea71787 100644 --- a/tpws/tpws.c +++ b/tpws/tpws.c @@ -122,14 +122,14 @@ static bool test_list_files() struct ipset_file *ifile; LIST_FOREACH(hfile, ¶ms.hostlists, next) - if (!file_open_test(hfile->filename, O_RDONLY)) + if (hfile->filename && !file_open_test(hfile->filename, O_RDONLY)) { DLOG_PERROR("file_open_test"); DLOG_ERR("cannot access hostlist file '%s'\n",hfile->filename); return false; } LIST_FOREACH(ifile, ¶ms.ipsets, next) - if (!file_open_test(ifile->filename, O_RDONLY)) + if (hfile->filename && !file_open_test(ifile->filename, O_RDONLY)) { DLOG_PERROR("file_open_test"); DLOG_ERR("cannot access ipset file '%s'\n",ifile->filename);