projects
/
project
/
firewall3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
use calloc instead of malloc+memset
[project/firewall3.git]
/
ipsets.c
diff --git
a/ipsets.c
b/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;