From 9d7d3799e9b37a36dfe61771a167f1451b3de8e4 Mon Sep 17 00:00:00 2001 From: David Hill Date: Sun, 9 Apr 2017 17:57:59 +0000 Subject: Use mallocarray to allocate multicast group memberships. ok deraadt@ --- sys/net/if_pfsync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/net/if_pfsync.c') 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; -- cgit v1.2.3