summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-11-16 22:09:21 +0000
committerguenther <guenther@openbsd.org>2014-11-16 22:09:21 +0000
commit4c8a5813923a3475e6b294bb4241e33bf195b045 (patch)
tree2d0246eade814364d624dc37e7ddf5b0ee42a335
parentWhen a line (in the sense of term_flushln()) contains white space only, (diff)
downloadwireguard-openbsd-4c8a5813923a3475e6b294bb4241e33bf195b045.tar.xz
wireguard-openbsd-4c8a5813923a3475e6b294bb4241e33bf195b045.zip
Correct an allocation size (was too large) by using sizeof(*ptr)
instead of sizeof(type). diff from Nicolas Bedos (nicolas.bedos (at) gmail.com)
-rw-r--r--bin/systrace/alias.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/systrace/alias.c b/bin/systrace/alias.c
index 00ce07b5062..ba874342705 100644
--- a/bin/systrace/alias.c
+++ b/bin/systrace/alias.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alias.c,v 1.6 2012/12/04 02:24:47 deraadt Exp $ */
+/* $OpenBSD: alias.c,v 1.7 2014/11/16 22:09:21 guenther Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -122,7 +122,7 @@ systrace_reverse(const char *emulation, const char *name)
if (reverse != NULL)
return (reverse);
- reverse = calloc(1, sizeof(struct systrace_alias));
+ reverse = calloc(1, sizeof(*reverse));
if (reverse == NULL)
err(1, "%s: %s-%s: malloc", __func__, emulation, name);
@@ -145,7 +145,7 @@ systrace_new_alias(const char *emulation, const char *name,
struct systrace_alias *alias;
struct systrace_revalias *reverse;
- alias = malloc(sizeof(struct systrace_alias));
+ alias = malloc(sizeof(*alias));
if (alias == NULL)
err(1, "%s: %s-%s: malloc", __func__, emulation, name);