GenFfs.c:545:5: error: pointer ?InFileHandle? used after ?fclose? [-Werror=use-after-free]
545 | Error(NULL, 0, 4001, "Resource", "memory cannot be allocated of %s", InFileHandle);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GenFfs.c:544:5: note: call to ?fclose? here
544 | fclose (InFileHandle);
| ^~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
PeFileBuffer = (UINT8 *) malloc (PeFileSize);\r
if (PeFileBuffer == NULL) {\r
fclose (InFileHandle);\r
- Error(NULL, 0, 4001, "Resource", "memory cannot be allocated of %s", InFileHandle);\r
+ Error(NULL, 0, 4001, "Resource", "memory cannot be allocated for %s", InFile);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle);\r
PeFileBuffer = (UINT8 *) malloc (PeFileSize);\r
if (PeFileBuffer == NULL) {\r
fclose (InFileHandle);\r
- Error(NULL, 0, 4001, "Resource", "memory cannot be allocated of %s", InFileHandle);\r
+ Error(NULL, 0, 4001, "Resource", "memory cannot be allocated for %s", InFile);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle);\r