iASL/Disassembler: Fix some possible memory leaks.

Fix for a few possible memory leaks in error recovery paths
Reported by Colin King <colin.king@canonical.com>
This commit is contained in:
Robert Moore 2013-06-04 13:17:45 -07:00
parent 48edcb1179
commit 50bf399c8e
3 changed files with 4 additions and 1 deletions

View File

@ -738,6 +738,7 @@ AcpiGetTagPathname (
Status = AcpiNsBuildExternalPath (BufferNode, RequiredSize, Pathname);
if (ACPI_FAILURE (Status))
{
ACPI_FREE (Pathname);
return (NULL);
}

View File

@ -539,12 +539,13 @@ DtCompileBuffer (
if (ACPI_FAILURE (Status))
{
DtError (ASL_ERROR, ASL_MSG_BUFFER_ELEMENT, Field, MsgBuffer);
return (ByteLength - Count);
goto Exit;
}
Buffer[i] = (UINT8) Value;
}
Exit:
ACPI_FREE (StringValue);
return (ByteLength - Count);
}

View File

@ -1200,4 +1200,5 @@ DtWriteTableToListing (
AcpiUtDumpBuffer (Buffer, Gbl_TableLength, DB_BYTE_DISPLAY, 0);
AcpiOsRedirectOutput (stdout);
ACPI_FREE (Buffer);
}