]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/GenCrc32: Fix file handles not being closed
authorHao Wu <hao.a.wu@intel.com>
Tue, 11 Oct 2016 07:47:02 +0000 (15:47 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 8 Nov 2016 08:37:59 +0000 (16:37 +0800)
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/C/GenCrc32/GenCrc32.c

index f4d129ee06ae4381b993145431220133ee15c5e5..e1e11c641368154e14d6fd782a8ceb4026af53a9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Calculate Crc32 value and Verify Crc32 value for input data.\r
 \r
 /** @file\r
 Calculate Crc32 value and Verify Crc32 value for input data.\r
 \r
-Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
 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
@@ -289,6 +289,7 @@ Returns:
   FileBuffer = (UINT8 *) malloc (FileSize);\r
   if (FileBuffer == NULL) {\r
     Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated!");\r
   FileBuffer = (UINT8 *) malloc (FileSize);\r
   if (FileBuffer == NULL) {\r
     Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated!");\r
+    fclose (InFile);\r
     goto Finish;\r
   }\r
   \r
     goto Finish;\r
   }\r
   \r