Fixed BehaviorSanitizer warnings

This commit is contained in:
akallabeth 2020-05-15 11:16:50 +02:00
parent 722790f4ca
commit 0502bfcfbc
1 changed files with 6 additions and 3 deletions

View File

@ -241,9 +241,12 @@ void sspi_CredentialsFree(SSPI_CREDENTIALS* credentials)
passwordLength *= 2;
}
memset(credentials->identity.User, 0, userLength);
memset(credentials->identity.Domain, 0, domainLength);
memset(credentials->identity.Password, 0, passwordLength);
if (credentials->identity.User)
memset(credentials->identity.User, 0, userLength);
if (credentials->identity.Domain)
memset(credentials->identity.Domain, 0, domainLength);
if (credentials->identity.Password)
memset(credentials->identity.Password, 0, passwordLength);
free(credentials->identity.User);
free(credentials->identity.Domain);
free(credentials->identity.Password);