lib: use strzero where applicable
Replace `memzero (s, strlen(s))` with just the internal wrapper `strzero (s)` where the underlying allocated size is not known.
This commit is contained in:
parent
14e7caf6b2
commit
e74bfe2c75
@ -80,7 +80,7 @@ void gr_free (/*@out@*/ /*@only@*/struct group *grent)
|
||||
{
|
||||
free (grent->gr_name);
|
||||
if (NULL != grent->gr_passwd) {
|
||||
memzero (grent->gr_passwd, strlen (grent->gr_passwd));
|
||||
strzero (grent->gr_passwd);
|
||||
free (grent->gr_passwd);
|
||||
}
|
||||
gr_free_members(grent);
|
||||
|
@ -73,7 +73,7 @@ void pw_free (/*@out@*/ /*@only@*/struct passwd *pwent)
|
||||
if (pwent != NULL) {
|
||||
free (pwent->pw_name);
|
||||
if (pwent->pw_passwd) {
|
||||
memzero (pwent->pw_passwd, strlen (pwent->pw_passwd));
|
||||
strzero (pwent->pw_passwd);
|
||||
free (pwent->pw_passwd);
|
||||
}
|
||||
free (pwent->pw_gecos);
|
||||
|
@ -128,7 +128,7 @@ void sgr_free (/*@out@*/ /*@only@*/struct sgrp *sgent)
|
||||
size_t i;
|
||||
free (sgent->sg_name);
|
||||
if (NULL != sgent->sg_passwd) {
|
||||
memzero (sgent->sg_passwd, strlen (sgent->sg_passwd));
|
||||
strzero (sgent->sg_passwd);
|
||||
free (sgent->sg_passwd);
|
||||
}
|
||||
for (i = 0; NULL != sgent->sg_adm[i]; i++) {
|
||||
|
@ -59,7 +59,7 @@ void spw_free (/*@out@*/ /*@only@*/struct spwd *spent)
|
||||
if (spent != NULL) {
|
||||
free (spent->sp_namp);
|
||||
if (NULL != spent->sp_pwdp) {
|
||||
memzero (spent->sp_pwdp, strlen (spent->sp_pwdp));
|
||||
strzero (spent->sp_pwdp);
|
||||
free (spent->sp_pwdp);
|
||||
}
|
||||
free (spent);
|
||||
|
Loading…
Reference in New Issue
Block a user