crypt32: Set correct return value if CryptMemAlloc fails.
This commit is contained in:
parent
502fc1aef9
commit
2b1c8fed24
|
@ -1466,6 +1466,8 @@ static BOOL compare_cert_by_cert_id(PCCERT_CONTEXT pCertContext, DWORD dwType,
|
|||
ret = !memcmp(buf, id->u.KeyId.pbData, size);
|
||||
CryptMemFree(buf);
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
|
@ -1506,6 +1508,8 @@ static BOOL compare_cert_by_signature_hash(PCCERT_CONTEXT pCertContext, DWORD dw
|
|||
ret = !memcmp(buf, hash->pbData, size);
|
||||
CryptMemFree(buf);
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
|
@ -2375,10 +2379,14 @@ BOOL WINAPI CryptSignAndEncodeCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCrypt
|
|||
}
|
||||
CryptMemFree(hash);
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
}
|
||||
CryptMemFree(encoded);
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -306,6 +306,8 @@ static BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert)
|
|||
ret = !memcmp(buf, info->KeyId.pbData, size);
|
||||
CryptMemFree(buf);
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
|
|
|
@ -122,6 +122,8 @@ static BOOL CRYPT_ReadBlobFromFile(HANDLE file, PCERT_BLOB blob)
|
|||
ret = ReadFile(file, blob->pbData, blob->cbData, &read, NULL) && read == blob->cbData;
|
||||
if (!ret) CryptMemFree(blob->pbData);
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,8 @@ static BOOL CRYPT_ReadBlobFromFile(LPCWSTR fileName, PCERT_BLOB blob)
|
|||
ret = ReadFile(file, blob->pbData, blob->cbData, &read, NULL) && read == blob->cbData;
|
||||
if (!ret) CryptMemFree(blob->pbData);
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
CloseHandle(file);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue