diff options
author | Martin Liska <mliska@suse.cz> | 2021-02-10 13:21:22 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-02-12 10:25:06 +0100 |
commit | bc6087c57540bfdcde533bc90197b6553fb8003c (patch) | |
tree | aaf485ebda0cecbd8486487d224311e34a042604 /gcc/opts.c | |
parent | cf059e1c099ed45c97f740c030dcb8e146ac7d4a (diff) | |
download | gcc-bc6087c57540bfdcde533bc90197b6553fb8003c.zip gcc-bc6087c57540bfdcde533bc90197b6553fb8003c.tar.gz gcc-bc6087c57540bfdcde533bc90197b6553fb8003c.tar.bz2 |
Fix producer string memory leaks
gcc/ChangeLog:
* opts-common.c (decode_cmdline_option): Release werror_arg.
* opts.c (gen_producer_string): Release output of
gen_command_line_string.
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -3401,8 +3401,11 @@ char * gen_producer_string (const char *language_string, cl_decoded_option *options, unsigned int options_count) { - return concat (language_string, " ", version_string, " ", - gen_command_line_string (options, options_count), NULL); + char *cmdline = gen_command_line_string (options, options_count); + char *combined = concat (language_string, " ", version_string, " ", + cmdline, NULL); + free (cmdline); + return combined; } #if CHECKING_P |