From: tobias Date: Wed, 14 Aug 2024 15:37:11 +0000 (+0000) Subject: Use freezero for better readability X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=413e8297772947bb0acb2230f1bc73c90c31d3ce;p=openbsd Use freezero for better readability It has the same meaning as the current pair of calling explicit_bzero and free. Spotted with Benny Baumann (BenBE at geshi dot org). ok djm@ --- diff --git a/usr.bin/ssh/sshbuf.c b/usr.bin/ssh/sshbuf.c index f76a2f37364..97568679cb5 100644 --- a/usr.bin/ssh/sshbuf.c +++ b/usr.bin/ssh/sshbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshbuf.c,v 1.20 2024/08/14 15:35:23 tobias Exp $ */ +/* $OpenBSD: sshbuf.c,v 1.21 2024/08/14 15:37:11 tobias Exp $ */ /* * Copyright (c) 2011 Damien Miller * @@ -183,10 +183,8 @@ sshbuf_free(struct sshbuf *buf) sshbuf_free(buf->parent); buf->parent = NULL; - if (!buf->readonly) { - explicit_bzero(buf->d, buf->alloc); - free(buf->d); - } + if (!buf->readonly) + freezero(buf->d, buf->alloc); freezero(buf, sizeof(*buf)); }