nla: clear identity memory before releasing

This commit is contained in:
Bernhard Miklautz 2015-06-26 15:12:33 +02:00
parent 2e87d0ee52
commit 77ef5a80de
1 changed files with 15 additions and 3 deletions

View File

@ -108,9 +108,21 @@ void nla_identity_free(SEC_WINNT_AUTH_IDENTITY* identity)
{
if (identity)
{
free(identity->User);
free(identity->Domain);
free(identity->Password);
if (identity->User)
{
memset(identity->User, 0, identity->UserLength*2);
free(identity->User);
}
if (identity->Password)
{
memset(identity->Password, 0, identity->PasswordLength*2);
free(identity->Password);
}
if (identity->Domain)
{
memset(identity->Domain, 0, identity->DomainLength*2);
free(identity->Domain);
}
}
free(identity);