From: Richard Biener Date: Wed, 10 Feb 2021 10:28:30 +0000 (+0100) Subject: fix memory leak in optimize pragma parsing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4985357e5aea698cbb5620fbfccc995363c7764;p=gcc.git 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. --- 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();