freezero() can be used here
authorderaadt <deraadt@openbsd.org>
Mon, 17 Apr 2017 21:48:26 +0000 (21:48 +0000)
committerderaadt <deraadt@openbsd.org>
Mon, 17 Apr 2017 21:48:26 +0000 (21:48 +0000)
libexec/ftpd/monitor.c

index 04b1e3f..9a2fbc5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: monitor.c,v 1.24 2016/04/25 15:43:34 deraadt Exp $    */
+/*     $OpenBSD: monitor.c,v 1.25 2017/04/17 21:48:26 deraadt Exp $    */
 
 /*
  * Copyright (c) 2004 Moritz Jodeit <moritz@openbsd.org>
@@ -284,8 +284,7 @@ handle_cmds(void)
                        preauth_slave_pid = slave_pid;
 
                        auth = pass(pw);
-                       explicit_bzero(pw, len);
-                       free(pw);
+                       freezero(pw, len);
 
                        switch (auth) {
                        case AUTH_FAILED: