From 4c20d8b89260a1bbb11ba1772773299867989596 Mon Sep 17 00:00:00 2001 From: guenther Date: Sat, 9 Aug 2014 22:44:15 +0000 Subject: [PATCH] Switch from calloc() to reallocarray() where the zeroing isn't needed --- bin/systrace/systrace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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++) -- 2.20.1