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>
This commit is contained in:
Jacob Garber 2019-05-16 22:00:27 -06:00 committed by Patrick Georgi
parent 40a85f85c6
commit b79d2dee2b
1 changed files with 1 additions and 0 deletions

View File

@ -11236,6 +11236,7 @@ static struct triple *relational_expr(struct compile_state *state)
arg_type = arithmetic_result(state, left, right); arg_type = arithmetic_result(state, left, right);
sign = is_signed(arg_type); sign = is_signed(arg_type);
xfree(arg_type);
op = -1; op = -1;
switch(tok) { switch(tok) {
case TOK_LESS: op = sign? OP_SLESS : OP_ULESS; break; case TOK_LESS: op = sign? OP_SLESS : OP_ULESS; break;