crypt32: Simplify a function.
This commit is contained in:
parent
59bcbb2d8b
commit
c3bc7f2cba
@ -786,21 +786,17 @@ static BOOL CRYPT_EncodeValueWithType(DWORD dwCertEncodingType,
|
||||
|
||||
if (value->end > value->start)
|
||||
{
|
||||
LONG i;
|
||||
LPWSTR ptr;
|
||||
|
||||
nameValue.Value.pbData = CryptMemAlloc((value->end - value->start) *
|
||||
sizeof(WCHAR));
|
||||
if (!nameValue.Value.pbData)
|
||||
{
|
||||
SetLastError(ERROR_OUTOFMEMORY);
|
||||
ret = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (ret)
|
||||
{
|
||||
if (value->end > value->start)
|
||||
{
|
||||
LONG i;
|
||||
LPWSTR ptr = (LPWSTR)nameValue.Value.pbData;
|
||||
|
||||
ptr = (LPWSTR)nameValue.Value.pbData;
|
||||
for (i = 0; i < value->end - value->start; i++)
|
||||
{
|
||||
*ptr++ = value->start[i];
|
||||
@ -825,7 +821,6 @@ static BOOL CRYPT_EncodeValueWithType(DWORD dwCertEncodingType,
|
||||
*ppszError = value->start + output->cbData;
|
||||
}
|
||||
CryptMemFree(nameValue.Value.pbData);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user