mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Bug 557893 - ProcessRDN leaks decodeItem on failure, r=kaie
--HG-- extra : rebase_source : 4cdfdf205b6de7a810a4bf86cacd5c3e1635aa8d
This commit is contained in:
parent
1ff0772521
commit
447ebae44b
@ -937,16 +937,20 @@ ProcessRDN(CERTRDN* rdn, nsAString &finalString, nsINSSComponent *nssComponent)
|
||||
PRIntn escapedValueCapacity = decodeItem->len * 3 + 3;
|
||||
nsAutoArrayPtr<char> escapedValue;
|
||||
escapedValue = new char[escapedValueCapacity];
|
||||
if (!escapedValue)
|
||||
if (!escapedValue) {
|
||||
SECITEM_FreeItem(decodeItem, PR_TRUE);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
SECStatus status = CERT_RFC1485_EscapeAndQuote(
|
||||
escapedValue.get(),
|
||||
escapedValueCapacity,
|
||||
(char*)decodeItem->data,
|
||||
decodeItem->len);
|
||||
if (SECSuccess != status)
|
||||
if (SECSuccess != status) {
|
||||
SECITEM_FreeItem(decodeItem, PR_TRUE);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
avavalue = NS_ConvertUTF8toUTF16(escapedValue);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user