crypt32: Remove redundant NULL checks before CryptMemFree (found by Smatch).
This commit is contained in:
parent
0c74c0a95b
commit
b96ac00764
|
@ -537,20 +537,13 @@ void free_protect_data(struct protect_data_t * pInfo)
|
||||||
|
|
||||||
if (!pInfo) return;
|
if (!pInfo) return;
|
||||||
|
|
||||||
if (pInfo->info0.pbData)
|
CryptMemFree(pInfo->info0.pbData);
|
||||||
CryptMemFree(pInfo->info0.pbData);
|
CryptMemFree(pInfo->info1.pbData);
|
||||||
if (pInfo->info1.pbData)
|
CryptMemFree(pInfo->szDataDescr);
|
||||||
CryptMemFree(pInfo->info1.pbData);
|
CryptMemFree(pInfo->data0.pbData);
|
||||||
if (pInfo->szDataDescr)
|
CryptMemFree(pInfo->salt.pbData);
|
||||||
CryptMemFree(pInfo->szDataDescr);
|
CryptMemFree(pInfo->cipher.pbData);
|
||||||
if (pInfo->data0.pbData)
|
CryptMemFree(pInfo->fingerprint.pbData);
|
||||||
CryptMemFree(pInfo->data0.pbData);
|
|
||||||
if (pInfo->salt.pbData)
|
|
||||||
CryptMemFree(pInfo->salt.pbData);
|
|
||||||
if (pInfo->cipher.pbData)
|
|
||||||
CryptMemFree(pInfo->cipher.pbData);
|
|
||||||
if (pInfo->fingerprint.pbData)
|
|
||||||
CryptMemFree(pInfo->fingerprint.pbData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copies a string into a data blob */
|
/* copies a string into a data blob */
|
||||||
|
@ -768,7 +761,7 @@ BOOL load_encryption_key(HCRYPTPROV hProv, DATA_BLOB * salt,
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
CryptDestroyHash(hSaltHash);
|
CryptDestroyHash(hSaltHash);
|
||||||
if (szUsername) CryptMemFree(szUsername);
|
CryptMemFree(szUsername);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue