Use freezero(3) where suitable
It originated in OpenBSD, and is available in libbsd. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
parent
8e0ad48c21
commit
1482224c54
@ -136,8 +136,7 @@ agetpass(const char *prompt)
|
|||||||
return pass;
|
return pass;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
memzero(pass, PASS_MAX);
|
freezero(pass, PASS_MAX);
|
||||||
free(pass);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,8 +144,5 @@ fail:
|
|||||||
void
|
void
|
||||||
erase_pass(char *pass)
|
erase_pass(char *pass)
|
||||||
{
|
{
|
||||||
if (pass == NULL)
|
freezero(pass, PASS_MAX);
|
||||||
return;
|
|
||||||
memzero(pass, PASS_MAX);
|
|
||||||
free(pass);
|
|
||||||
}
|
}
|
||||||
|
@ -274,10 +274,8 @@ static /*@observer@*//*@null@*/const char *obscure_msg (
|
|||||||
|
|
||||||
msg = password_check (old1, new1, pwdp);
|
msg = password_check (old1, new1, pwdp);
|
||||||
|
|
||||||
memzero (new1, newlen);
|
freezero (new1, newlen);
|
||||||
memzero (old1, oldlen);
|
freezero (old1, oldlen);
|
||||||
free (new1);
|
|
||||||
free (old1);
|
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user