]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Common/MemoryFile.c
BaseTools/C/Common: Fix potential memory leak
[mirror_edk2.git] / BaseTools / Source / C / Common / MemoryFile.c
index 00ea0c615b7a2a01b4ad9aeb26f86af8a3ba2fc2..1d9068822ef40ecf6380f6335e41ebb8a119c993 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 This contains some useful functions for accessing files.\r
 \r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -69,6 +69,7 @@ Returns:
 \r
   NewMemoryFile = malloc (sizeof (*NewMemoryFile));\r
   if (NewMemoryFile == NULL) {\r
+    free (InputFileImage);\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r