summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2017-05-06 19:44:54 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2017-05-06 19:44:54 +0000
commit393511e84bf5f5c419dc38667997205e4e61aee4 (patch)
tree41df348941ed3719217d3f67fecfac29c1d90dae /usr.sbin
parent14f3291d7ba501d11a53b637a72346fd9bfdd523 (diff)
Convert explicit_bzero() + free() to freezero().
OK reyk@, deraadt@ (previous version)
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/relayd/relayd.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c
index 2730f9f2902..53996b21b30 100644
--- a/usr.sbin/relayd/relayd.c
+++ b/usr.sbin/relayd/relayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.c,v 1.165 2017/01/24 10:49:14 benno Exp $ */
+/* $OpenBSD: relayd.c,v 1.166 2017/05/06 19:44:53 fcambus Exp $ */
/*
* Copyright (c) 2007 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -543,17 +543,11 @@ purge_table(struct relayd *env, struct tablelist *head, struct table *table)
}
void
-purge_key(char **ptr, off_t len)
+purge_key(char **key, off_t len)
{
- char *key = *ptr;
+ freezero(*key, len);
- if (key == NULL || len == 0)
- return;
-
- explicit_bzero(key, len);
- free(key);
-
- *ptr = NULL;
+ *key = NULL;
}
void