summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2019-05-16 22:00:27 -0600
committerPatrick Georgi <pgeorgi@google.com>2019-05-21 09:27:57 +0000
commitb79d2dee2b2f294aac97dad849909d7bfb892c76 (patch)
tree23b50bc5f47024926fb13703ef591a3f310999b7 /util
parent40a85f85c68902f8e16f3088bd94ab5ab83e7749 (diff)
downloadcoreboot-b79d2dee2b2f294aac97dad849909d7bfb892c76.tar.xz
util/romcc: Free variable after it is used
Free 'arg_type' after it is used to prevent a memory leak. Found-by: Coverity Scan CID 1129114 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Change-Id: I5e8661547bb7623463ed23fc45269049ffb8c50e Reviewed-on: https://review.coreboot.org/c/coreboot/+/32841 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util')
-rw-r--r--util/romcc/romcc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c
index 97cc2191e7..bf0510a49f 100644
--- a/util/romcc/romcc.c
+++ b/util/romcc/romcc.c
@@ -11236,6 +11236,7 @@ static struct triple *relational_expr(struct compile_state *state)
arg_type = arithmetic_result(state, left, right);
sign = is_signed(arg_type);
+ xfree(arg_type);
op = -1;
switch(tok) {
case TOK_LESS: op = sign? OP_SLESS : OP_ULESS; break;