From: guenther Date: Sat, 9 Aug 2014 22:44:15 +0000 (+0000) Subject: Switch from calloc() to reallocarray() where the zeroing isn't needed X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4c20d8b89260a1bbb11ba1772773299867989596;p=openbsd Switch from calloc() to reallocarray() where the zeroing isn't needed --- diff --git a/bin/systrace/systrace.c b/bin/systrace/systrace.c index 80a3fa4a96d..86fac087890 100644 --- a/bin/systrace/systrace.c +++ b/bin/systrace/systrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: systrace.c,v 1.58 2012/12/04 02:24:47 deraadt Exp $ */ +/* $OpenBSD: systrace.c,v 1.59 2014/08/09 22:44:15 guenther Exp $ */ /* * Copyright 2002 Niels Provos * All rights reserved. @@ -753,7 +753,8 @@ main(int argc, char **argv) if (pidattach == 0) { /* Run a command and attach to it */ - if ((args = calloc(argc + 1, sizeof(char *))) == NULL) + args = reallocarray(NULL, argc + 1, sizeof(char *)); + if (args == NULL) err(1, "malloc"); for (i = 0; i < argc; i++)