[openssh-commits] [openssh] 04/09: upstream: Use freezero for better readability

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Aug 15 12:21:04 AEST 2024


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit fc48ddf6998188517af42dce807e2088b6a0c0be
Author: tobias at openbsd.org <tobias at openbsd.org>
AuthorDate: Wed Aug 14 15:37:11 2024 +0000

    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
---
 sshbuf.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sshbuf.c b/sshbuf.c
index 8e97355f..690dce6f 100644
--- 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));
 }
 

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list