summaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
authorjsg@openbsd.org <jsg@openbsd.org>2020-02-26 13:40:09 +0000
committerDamien Miller <djm@mindrot.org>2020-02-28 12:26:28 +1100
commitd5ba1c03278eb079438bb038266d80d7477d49cb (patch)
tree6d8dd2d802af796bcb7c9d6d018196a448bb9ff6 /hostfile.c
parent9e3220b585c5be19a7431ea4ff8884c137b3a81c (diff)
downloadopenssh-git-d5ba1c03278eb079438bb038266d80d7477d49cb.tar.gz
upstream: change explicit_bzero();free() to freezero()
While freezero() returns early if the pointer is NULL the tests for NULL in callers are left to avoid warnings about passing an uninitialised size argument across a function boundry. ok deraadt@ djm@ OpenBSD-Commit-ID: 2660fa334fcc7cd05ec74dd99cb036f9ade6384a
Diffstat (limited to 'hostfile.c')
-rw-r--r--hostfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hostfile.c b/hostfile.c
index 4a0349a6..7af47adf 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostfile.c,v 1.77 2020/01/25 00:21:08 djm Exp $ */
+/* $OpenBSD: hostfile.c,v 1.78 2020/02/26 13:40:09 jsg Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -298,8 +298,7 @@ free_hostkeys(struct hostkeys *hostkeys)
explicit_bzero(hostkeys->entries + i, sizeof(*hostkeys->entries));
}
free(hostkeys->entries);
- explicit_bzero(hostkeys, sizeof(*hostkeys));
- free(hostkeys);
+ freezero(hostkeys, sizeof(*hostkeys));
}
static int