summaryrefslogtreecommitdiff
path: root/sys/net/hfsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/hfsc.c')
-rw-r--r--sys/net/hfsc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/hfsc.c b/sys/net/hfsc.c
index 2e8d27594ca..c990ff503f3 100644
--- a/sys/net/hfsc.c
+++ b/sys/net/hfsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hfsc.c,v 1.12 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: hfsc.c,v 1.13 2014/12/09 07:05:06 doug Exp $ */
/*
* Copyright (c) 2012-2013 Henning Brauer <henning@openbsd.org>
@@ -144,7 +144,8 @@ hfsc_grow_class_tbl(struct hfsc_if *hif, u_int howmany)
{
struct hfsc_class **newtbl, **old;
- newtbl = malloc(howmany * sizeof(void *), M_DEVBUF, M_WAITOK | M_ZERO);
+ newtbl = mallocarray(howmany, sizeof(void *), M_DEVBUF,
+ M_WAITOK | M_ZERO);
old = hif->hif_class_tbl;
memcpy(newtbl, old, hif->hif_allocated * sizeof(void *));