mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
Fix a premature freeing bug found with malloc debugging courtesy John Hay.
Submitted by: jhay
This commit is contained in:
parent
31c8f3f0af
commit
0debe874a0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65101
|
@ -132,7 +132,6 @@ getnewpasswd(pw, nis)
|
|||
}
|
||||
/* mixpasswordcase capability */
|
||||
force_mix_case = login_getcapbool(lc, "mixpasswordcase", 1);
|
||||
login_close(lc);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -172,8 +171,13 @@ getnewpasswd(pw, nis)
|
|||
#else
|
||||
/* Make a good size salt for algoritms that can use it. */
|
||||
gettimeofday(&tv,0);
|
||||
#ifdef LOGIN_CAP
|
||||
if (login_setcryptfmt(lc, "md5", NULL) == NULL)
|
||||
pw_error("cannot set password cipher", 1, 1);
|
||||
login_close(lc);
|
||||
#else
|
||||
(void)crypt_set_format("md5");
|
||||
#endif
|
||||
/* Salt suitable for anything */
|
||||
to64(&salt[0], random(), 3);
|
||||
to64(&salt[3], tv.tv_usec, 3);
|
||||
|
|
Loading…
Reference in a new issue