[coreboot-gerrit] New patch to review for coreboot: util/romcc: free variable after use

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Mon Jan 2 19:26:09 CET 2017


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18015

-gerrit

commit 5183b81985321b7da6a2ff28f2032ee84930f5d8
Author: Patrick Georgi <pgeorgi at chromium.org>
Date:   Mon Jan 2 18:54:28 2017 +0100

    util/romcc: free variable after use
    
    closure_type is copied then never used again. Close that leak.
    
    Change-Id: Idd4201f7fc6495fde5ad2e1feb7e499e38986e92
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Found-by: Coverity Scan #1287073
---
 util/romcc/romcc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c
index 871dde1..7217c8c 100644
--- a/util/romcc/romcc.c
+++ b/util/romcc/romcc.c
@@ -14376,6 +14376,8 @@ static void expand_function_call(
 
 	/* Update the called functions closure variable */
 	closure_idx = add_closure_type(state, func, closure_type);
+	free(closure_type);
+	closure_type = NULL;
 
 	/* Generate some needed triples */
 	ret_loc = label(state);



More information about the coreboot-gerrit mailing list