diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-04-24 01:57:07 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-04-24 01:57:07 +0000 |
commit | 2a58b592e198f009e5fb3f8a01799d963ac71996 (patch) | |
tree | c9c0ce65d98f149a31bad808c4bd86d060580684 /bin/systrace/intercept.c | |
parent | 650dd9689c1865c64448e91c34921ce63e276453 (diff) |
calloc is better. from Peter Malone
Diffstat (limited to 'bin/systrace/intercept.c')
-rw-r--r-- | bin/systrace/intercept.c | 9 |
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); |