From f23cba082c86bd7dd33ea3c26057206d790b3dab Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 15 Dec 2016 15:12:16 +0100 Subject: [PATCH] util/romcc: Fix resource leak Change-Id: I0d260254bab714ec939fc199b3a133b0fc05b10d Signed-off-by: Patrick Georgi Found-by: Coverity Scan #1129112 Reviewed-on: https://review.coreboot.org/17883 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- util/romcc/romcc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c index c97312cc44..9a9016741f 100644 --- a/util/romcc/romcc.c +++ b/util/romcc/romcc.c @@ -10779,6 +10779,7 @@ static struct triple *string_constant(struct compile_state *state) ptr = buf; buf = xmalloc(type->elements + str_len + 1, "string_constant"); memcpy(buf, ptr, type->elements); + free(ptr); ptr = buf + type->elements; do { *ptr++ = char_value(state, &str, end);