nfqws,tpws: remove null pointer checks before free()

This commit is contained in:
bol-van
2025-01-09 18:56:01 +03:00
parent f21bd0c63c
commit 29ff997a3f
7 changed files with 19 additions and 33 deletions

View File

@@ -139,7 +139,7 @@ bool strlist_add(struct str_list_head *head, const char *filename)
}
static void strlist_entry_destroy(struct str_list *entry)
{
if (entry->str) free(entry->str);
free(entry->str);
free(entry);
}
void strlist_destroy(struct str_list_head *head)
@@ -177,7 +177,7 @@ struct hostlist_file *hostlist_files_add(struct hostlist_files_head *head, const
}
static void hostlist_files_entry_destroy(struct hostlist_file *entry)
{
if (entry->filename) free(entry->filename);
free(entry->filename);
StrPoolDestroy(&entry->hostlist);
free(entry);
}
@@ -391,7 +391,7 @@ struct ipset_file *ipset_files_add(struct ipset_files_head *head, const char *fi
}
static void ipset_files_entry_destroy(struct ipset_file *entry)
{
if (entry->filename) free(entry->filename);
free(entry->filename);
ipsetDestroy(&entry->ipset);
free(entry);
}