From d5ba1c03278eb079438bb038266d80d7477d49cb Mon Sep 17 00:00:00 2001 From: "jsg@openbsd.org" Date: Wed, 26 Feb 2020 13:40:09 +0000 Subject: 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 --- hostfile.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'hostfile.c') 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 * Copyright (c) 1995 Tatu Ylonen , 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 -- cgit v1.2.3