]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Use freezero for better readability
authortobias@openbsd.org <tobias@openbsd.org>
Wed, 14 Aug 2024 15:37:11 +0000 (15:37 +0000)
committerDamien Miller <djm@mindrot.org>
Thu, 15 Aug 2024 01:01:49 +0000 (11:01 +1000)
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

sshbuf.c

index 8e97355fae4594c270348845ba9f6d0f5fa82415..690dce6fa98873f9d0f8bc9dd06120ba4e1a96cc 100644 (file)
--- a/sshbuf.c
+++ b/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
  *
@@ -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));
 }