Reviewed-by: Yonghong Zhu <yonghong....@intel.com>

Best Regards,
Zhu Yonghong


-----Original Message-----
From: Feng, YunhuaX 
Sent: Tuesday, April 10, 2018 9:10 AM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong <yonghong....@intel.com>; Gao, Liming <liming....@intel.com>
Subject: [PATCH 1/3] BaseTools: Correct GenSec argument dummy free memory issue

Free DummyFileBuffer and set DummyFileBuffer to NULL.

Cc: Liming Gao <liming....@intel.com>
Cc: Yonghong Zhu <yonghong....@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1

Signed-off-by: Yunhua Feng <yunhuax.f...@intel.com>
---
 BaseTools/Source/C/GenSec/GenSec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c 
b/BaseTools/Source/C/GenSec/GenSec.c
index fb5bc5e992..56767d5a9b 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1,9 +1,9 @@
 /** @file
 Creates output file that is a properly formed section per the PI spec.
 
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials                          
 are licensed and made available under the terms and conditions of the BSD 
License         
 which accompanies this distribution.  The full text of the license may be 
found at        
 http://opensource.org/licenses/bsd-license.php                                 
           
                                                                                
           
@@ -1374,10 +1374,11 @@ Returns:
       if (SectGuidHeaderLength == 0) {
         SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED;
       }
       if (DummyFileBuffer != NULL) {
         free (DummyFileBuffer);
+        DummyFileBuffer = NULL;
       }
       if (InFileBuffer != NULL) {
         free (InFileBuffer);
       }
     }
-- 
2.12.2.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to