diff options
author | jsg@openbsd.org <jsg@openbsd.org> | 2020-02-26 13:40:09 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-02-28 12:26:28 +1100 |
commit | d5ba1c03278eb079438bb038266d80d7477d49cb (patch) | |
tree | 6d8dd2d802af796bcb7c9d6d018196a448bb9ff6 /hostfile.c | |
parent | 9e3220b585c5be19a7431ea4ff8884c137b3a81c (diff) |
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.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/hostfile.c b/hostfile.c index 4a0349a60..7af47adf3 100644 --- a/hostfile.c +++ b/hostfile.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: hostfile.c,v 1.77 2020/01/25 00:21:08 djm Exp $ */ | 1 | /* $OpenBSD: hostfile.c,v 1.78 2020/02/26 13:40:09 jsg Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -298,8 +298,7 @@ free_hostkeys(struct hostkeys *hostkeys) | |||
298 | explicit_bzero(hostkeys->entries + i, sizeof(*hostkeys->entries)); | 298 | explicit_bzero(hostkeys->entries + i, sizeof(*hostkeys->entries)); |
299 | } | 299 | } |
300 | free(hostkeys->entries); | 300 | free(hostkeys->entries); |
301 | explicit_bzero(hostkeys, sizeof(*hostkeys)); | 301 | freezero(hostkeys, sizeof(*hostkeys)); |
302 | free(hostkeys); | ||
303 | } | 302 | } |
304 | 303 | ||
305 | static int | 304 | static int |