BaseTools: Correct GenSec argument dummy free memory issue
authorFeng, YunhuaX </o=Intel/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Feng, YunhuaX4e1>
Tue, 10 Apr 2018 01:09:45 +0000 (09:09 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Wed, 11 Apr 2018 06:36:26 +0000 (14:36 +0800)
Free DummyFileBuffer and set DummyFileBuffer to NULL.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/C/GenSec/GenSec.c

index fb5bc5e9925403cf4d01cbb100561003c6986cc7..56767d5a9b35e4df4de731e7af9e8b7fcfb24376 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Creates output file that is a properly formed section per the PI spec.\r
 \r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, 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
@@ -1376,6 +1376,7 @@ Returns:
       }\r
       if (DummyFileBuffer != NULL) {\r
         free (DummyFileBuffer);\r
+        DummyFileBuffer = NULL;\r
       }\r
       if (InFileBuffer != NULL) {\r
         free (InFileBuffer);\r