summaryrefslogtreecommitdiff
path: root/bin/systrace/intercept.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-04-24 01:57:07 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-04-24 01:57:07 +0000
commit2a58b592e198f009e5fb3f8a01799d963ac71996 (patch)
treec9c0ce65d98f149a31bad808c4bd86d060580684 /bin/systrace/intercept.c
parent650dd9689c1865c64448e91c34921ce63e276453 (diff)
calloc is better. from Peter Malone
Diffstat (limited to 'bin/systrace/intercept.c')
-rw-r--r--bin/systrace/intercept.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/systrace/intercept.c b/bin/systrace/intercept.c
index e4c768730cd..c3eb23ee9f1 100644
--- a/bin/systrace/intercept.c
+++ b/bin/systrace/intercept.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intercept.c,v 1.60 2012/12/04 02:24:47 deraadt Exp $ */
+/* $OpenBSD: intercept.c,v 1.61 2014/04/24 01:57:06 tedu Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -197,7 +197,7 @@ intercept_register_sccb(char *emulation, char *name,
}
if ((tmp = calloc(1, sizeof(struct intercept_syscall))) == NULL) {
- warn("%s:%d: malloc", __func__, __LINE__);
+ warn("%s:%d: calloc", __func__, __LINE__);
return (-1);
}
@@ -426,10 +426,9 @@ intercept_getpid(pid_t pid)
if (tmp)
return (tmp);
- if ((tmp = malloc(sizeof(struct intercept_pid))) == NULL)
- err(1, "%s: malloc", __func__);
+ if ((tmp = calloc(1, sizeof(struct intercept_pid))) == NULL)
+ err(1, "%s: calloc", __func__);
- memset(tmp, 0, sizeof(struct intercept_pid));
tmp->pid = pid;
SPLAY_INSERT(pidtree, &pids, tmp);