mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Plug memleak on mismatched length
This commit is contained in:
parent
4796f01209
commit
34e7cbb6fe
@ -425,8 +425,10 @@ static int chk_totp(
|
||||
memset(key.mv_val, 0, key.mv_len);
|
||||
|
||||
/* compare */
|
||||
if (out.mv_len != cred->bv_len)
|
||||
return LUTIL_PASSWD_ERR;
|
||||
if (out.mv_len != cred->bv_len) {
|
||||
rc = LUTIL_PASSWD_ERR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
rc = memcmp(out.mv_val, cred->bv_val, out.mv_len) ? LUTIL_PASSWD_ERR : LUTIL_PASSWD_OK;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user