diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -257,6 +257,9 @@ { struct pfctl_status_counter *c, *tmp; + if (status == NULL) + return; + TAILQ_FOREACH_SAFE(c, &status->counters, entry, tmp) { free(c->name); free(c);