summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2014-05-23 13:28:32 +0000
committerespie <espie@openbsd.org>2014-05-23 13:28:32 +0000
commit362966cb49c6df535b7caa3f44eb146b4e2ec7fa (patch)
treea2b8ddeed4bdce2201820aaa10a5bd19adbac126
parentadjust the note in STANDARDS: passing args to the flags is not an (diff)
downloadwireguard-openbsd-362966cb49c6df535b7caa3f44eb146b4e2ec7fa.tar.xz
wireguard-openbsd-362966cb49c6df535b7caa3f44eb146b4e2ec7fa.zip
use reallocarray
okay gilles@
-rw-r--r--usr.sbin/smtpd/smtpctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c
index 0b42365be5c..f3c5cca8657 100644
--- a/usr.sbin/smtpd/smtpctl.c
+++ b/usr.sbin/smtpd/smtpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpctl.c,v 1.120 2014/05/20 18:47:01 eric Exp $ */
+/* $OpenBSD: smtpctl.c,v 1.121 2014/05/23 13:28:32 espie Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -317,9 +317,10 @@ srv_iter_evpids(uint32_t msgid, uint64_t *evpid, int *offset)
while (srv_iter_envelopes(msgid, &evp)) {
if (n == alloc) {
alloc += 256;
- evpids = realloc(evpids, alloc * sizeof(*evpids));
+ evpids = reallocarray(evpids, alloc,
+ sizeof(*evpids));
if (evpids == NULL)
- err(1, "realloc");
+ err(1, "reallocarray");
}
evpids[n++] = evp.id;
}