Use OpenBSD-compatible freezero() in place of explicit_bzero() + free()

This commit is contained in:
Todd C. Miller
2020-08-10 19:24:33 -06:00
parent cef6e3687e
commit ce97ca28db
19 changed files with 105 additions and 37 deletions

View File

@@ -101,10 +101,8 @@ sudo_secureware_cleanup(struct passwd *pw, sudo_auth *auth, bool force)
char *pw_epasswd = auth->data;
debug_decl(sudo_secureware_cleanup, SUDOERS_DEBUG_AUTH);
if (pw_epasswd != NULL) {
explicit_bzero(pw_epasswd, strlen(pw_epasswd));
free(pw_epasswd);
}
if (pw_epasswd != NULL)
freezero(pw_epasswd, strlen(pw_epasswd));
debug_return_int(AUTH_SUCCESS);
}