summaryrefslogtreecommitdiff
path: root/sys/net/if_pfsync.c
diff options
context:
space:
mode:
authorDavid Hill <dhill@cvs.openbsd.org>2017-04-09 17:57:59 +0000
committerDavid Hill <dhill@cvs.openbsd.org>2017-04-09 17:57:59 +0000
commit9d7d3799e9b37a36dfe61771a167f1451b3de8e4 (patch)
treee9a96b793d1f4da20401fdee4d218f2f9dcec933 /sys/net/if_pfsync.c
parentc061d38f5cd4303f0be4f5f67669cee091528ce4 (diff)
Use mallocarray to allocate multicast group memberships.
ok deraadt@
Diffstat (limited to 'sys/net/if_pfsync.c')
-rw-r--r--sys/net/if_pfsync.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 80f3787e4a4..f8029836177 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.247 2017/04/05 13:35:18 deraadt Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.248 2017/04/09 17:57:58 dhill Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -316,8 +316,8 @@ pfsync_clone_create(struct if_clone *ifc, int unit)
sc->sc_len = PFSYNC_MINPKT;
sc->sc_maxupdates = 128;
- sc->sc_imo.imo_membership = (struct in_multi **)malloc(
- (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_IPMOPTS,
+ sc->sc_imo.imo_membership = (struct in_multi **)mallocarray(
+ IP_MIN_MEMBERSHIPS, sizeof(struct in_multi *), M_IPMOPTS,
M_WAITOK | M_ZERO);
sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS;