MINOR: config: Don't dump keywords if argument is NULL

Helper functions are used to dump bind, server or filter keywords. These
functions are used to report errors during the configuration parsing. To have a
coherent API, these functions are now prepared to handle a null pointer as
argument. If so, no action is performed and functions immediately return.

This patch should fix the issue #631. It is not a bug. There is no reason to
backport it.
This commit is contained in:
Christopher Faulet 2020-05-18 12:14:18 +02:00
parent 2a37cdbe6b
commit 784063eeb2
3 changed files with 9 additions and 0 deletions

View File

@ -142,6 +142,9 @@ flt_dump_kws(char **out)
struct flt_kw_list *kwl;
int index;
if (!out)
return;
*out = NULL;
list_for_each_entry(kwl, &flt_keywords.list, list) {
for (index = 0; kwl->kw[index].kw != NULL; index++) {

View File

@ -1255,6 +1255,9 @@ void bind_dump_kws(char **out)
struct bind_kw_list *kwl;
int index;
if (!out)
return;
*out = NULL;
list_for_each_entry(kwl, &bind_keywords.list, list) {
for (index = 0; kwl->kw[index].kw != NULL; index++) {

View File

@ -247,6 +247,9 @@ void srv_dump_kws(char **out)
struct srv_kw_list *kwl;
int index;
if (!out)
return;
*out = NULL;
list_for_each_entry(kwl, &srv_keywords.list, list) {
for (index = 0; kwl->kw[index].kw != NULL; index++) {