From 9eb7669cc040882992dee3621ebacf4f0311e8a0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 10 Feb 2021 09:13:01 +0100 Subject: [PATCH] ipa/99029 - fix memory leak in propagate_malloc This makes sure to release the vec<> of callees. 2021-02-10 Richard Biener PR ipa/99029 * ipa-pure-const.c (propagate_malloc): Use an auto_vec<> for callees. --- gcc/ipa-pure-const.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 957217a..f045108 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -1937,7 +1937,7 @@ propagate_malloc (void) if (l->malloc_state == STATE_MALLOC_BOTTOM) continue; - vec callees = vNULL; + auto_vec callees; for (cgraph_edge *cs = node->callees; cs; cs = cs->next_callee) { ipa_call_summary *es = ipa_call_summaries->get_create (cs); -- 2.7.4