From e4985357e5aea698cbb5620fbfccc995363c7764 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 10 Feb 2021 11:28:30 +0100 Subject: [PATCH] fix memory leak in optimize pragma parsing The optimize pragma/attribute parsing calls decode_cmdline_options_to_array but doesn't free the array. The following fixes that. 2021-02-10 Richard Biener gcc/c-family/ * c-common.c (parse_optimize_options): Free decoded_options. --- gcc/c-family/c-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 813212cc21d..088626d1e09 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -5770,6 +5770,7 @@ parse_optimize_options (tree args, bool attr_p) decode_options (&global_options, &global_options_set, decoded_options, decoded_options_count, input_location, global_dc, NULL); + free (decoded_options); targetm.override_options_after_change(); -- 2.30.2