mirror of
https://github.com/acidanthera/audk.git
synced 2025-09-25 10:47:47 +02:00
BaseTools/ImageTool: Fix PeScan error handling
This commit is contained in:
parent
d5eecc2e2d
commit
b1851ef38d
@ -107,7 +107,6 @@ PeXip (
|
|||||||
Pe = NULL;
|
Pe = NULL;
|
||||||
|
|
||||||
if (!Result) {
|
if (!Result) {
|
||||||
ToolImageDestruct (&Image);
|
|
||||||
return RETURN_ABORTED;
|
return RETURN_ABORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,6 +450,7 @@ ToolContextConstructPe (
|
|||||||
Result = ScanPeGetHeaderInfo (&Image->HeaderInfo, &Context, ModuleType);
|
Result = ScanPeGetHeaderInfo (&Image->HeaderInfo, &Context, ModuleType);
|
||||||
if (!Result) {
|
if (!Result) {
|
||||||
fprintf (stderr, "ImageTool: Could not retrieve header info\n");
|
fprintf (stderr, "ImageTool: Could not retrieve header info\n");
|
||||||
|
ToolImageDestruct (Image);
|
||||||
FreeAlignedPages (Destination, DestinationPages);
|
FreeAlignedPages (Destination, DestinationPages);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -457,6 +458,7 @@ ToolContextConstructPe (
|
|||||||
Result = ScanPeGetDebugInfo (&Image->DebugInfo, &Context);
|
Result = ScanPeGetDebugInfo (&Image->DebugInfo, &Context);
|
||||||
if (!Result) {
|
if (!Result) {
|
||||||
fprintf (stderr, "ImageTool: Could not retrieve debug info\n");
|
fprintf (stderr, "ImageTool: Could not retrieve debug info\n");
|
||||||
|
ToolImageDestruct (Image);
|
||||||
FreeAlignedPages (Destination, DestinationPages);
|
FreeAlignedPages (Destination, DestinationPages);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -464,6 +466,7 @@ ToolContextConstructPe (
|
|||||||
Result = ScanPeGetSegmentInfo (&Image->SegmentInfo, &Image->HiiInfo, &Context);
|
Result = ScanPeGetSegmentInfo (&Image->SegmentInfo, &Image->HiiInfo, &Context);
|
||||||
if (!Result) {
|
if (!Result) {
|
||||||
fprintf (stderr, "ImageTool: Could not retrieve segment info\n");
|
fprintf (stderr, "ImageTool: Could not retrieve segment info\n");
|
||||||
|
ToolImageDestruct (Image);
|
||||||
FreeAlignedPages (Destination, DestinationPages);
|
FreeAlignedPages (Destination, DestinationPages);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -471,6 +474,7 @@ ToolContextConstructPe (
|
|||||||
Result = ScanPeGetRelocInfo (&Image->RelocInfo, &Context);
|
Result = ScanPeGetRelocInfo (&Image->RelocInfo, &Context);
|
||||||
if (!Result) {
|
if (!Result) {
|
||||||
fprintf (stderr, "ImageTool: Could not retrieve reloc info\n");
|
fprintf (stderr, "ImageTool: Could not retrieve reloc info\n");
|
||||||
|
ToolImageDestruct (Image);
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeAlignedPages (Destination, DestinationPages);
|
FreeAlignedPages (Destination, DestinationPages);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user