diff options
author | tobias@openbsd.org <tobias@openbsd.org> | 2024-08-14 17:37:11 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2024-08-15 03:01:49 +0200 |
commit | fc48ddf6998188517af42dce807e2088b6a0c0be (patch) | |
tree | 12184683722e6cfad455b3e161a921bae3ca8bad /sshbuf.c | |
parent | upstream: Fix typo in comment (diff) | |
download | openssh-fc48ddf6998188517af42dce807e2088b6a0c0be.tar.xz openssh-fc48ddf6998188517af42dce807e2088b6a0c0be.zip |
upstream: 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@
OpenBSD-Commit-ID: 939fbe9ccf52d0d48c5fa53694d6f3bb9927970c
Diffstat (limited to '')
-rw-r--r-- | sshbuf.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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 * @@ -185,10 +185,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)); } |