diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2014-05-23 13:28:33 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2014-05-23 13:28:33 +0000 |
commit | 17559a9f34b8f64eb33ee96144800807a3fcb5a3 (patch) | |
tree | c7f9b69ccf1cd0f5a19954d7c3bc6a63c5c4c69f | |
parent | a757ff827530d657356e6c6bb14fd3321ad1b751 (diff) |
use reallocarray
okay gilles@
-rw-r--r-- | usr.sbin/smtpd/smtpctl.c | 7 |
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; } |