Commit 2b1c8fed authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

crypt32: Set correct return value if CryptMemAlloc fails.

parent 502fc1ae
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment