aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorMartin Kepplinger <martink@posteo.de>2017-09-10 14:02:02 +0200
committerChristopher Li <sparse@chrisli.org>2017-09-12 01:16:52 -0400
commit2093505d7b706bf5e0cc59b5d5fdf49891c24d48 (patch)
tree93fb3fe5e9f469045e42e03bc2cc279f1286f844
parent23a393b1cd48ea50bff94fa4a1e2c02a5d78d9cb (diff)
downloadsparse-dev-2093505d7b706bf5e0cc59b5d5fdf49891c24d48.tar.gz
compile-i386.c: fix a memory leak in sort_array()
sort_array() locally allocates a list it. Let's free it before returning in order to avoid memory to leak. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Christopher Li <sparse@chrisli.org>
-rw-r--r--compile-i386.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/compile-i386.c b/compile-i386.c
index 44b72ec3..e4d3f27d 100644
--- a/compile-i386.c
+++ b/compile-i386.c
@@ -1048,6 +1048,7 @@ static void sort_array(struct expression *expr)
*THIS_ADDRESS(entry) = list[i++];
} END_FOR_EACH_PTR(entry);
+ free(list);
}
static void emit_array(struct symbol *sym)