crypt32: Set correct return value if CryptMemAlloc fails.

This commit is contained in:
Sebastian Lackner 2013-12-08 06:09:17 +01:00 committed by Alexandre Julliard
parent 502fc1aef9
commit 2b1c8fed24
4 changed files with 14 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
}