use calloc instead of malloc+memset
[project/firewall3.git] / ipsets.c
index 8f88885546c68bb16f124294c51b073d10be68a2..5b319a58e8fbf5120f3dbc08494906aadb79ce30 100644 (file)
--- a/ipsets.c
+++ b/ipsets.c
@@ -203,13 +203,10 @@ fw3_alloc_ipset(void)
 {
        struct fw3_ipset *ipset;
 
-       ipset = malloc(sizeof(*ipset));
-
+       ipset = calloc(1, sizeof(*ipset));
        if (!ipset)
                return NULL;
 
-       memset(ipset, 0, sizeof(*ipset));
-
        INIT_LIST_HEAD(&ipset->datatypes);
 
        ipset->enabled = true;