From: Johannes Schindelin Date: Thu, 06 Apr 2017 08:55:17 GMT Subject: Re: [PATCH 2/2] Fix stack-use-after-scope error reported by ASAN by GCC 7. Message-ID: In-Reply-To: <072afb58-6159-ddeb-b7dc-40a87e8c6ae7@suse.cz> Hi Martin, On Thu, 6 Apr 2017, Martin Liška wrote: > Following patch fixes issues that can be seen with -fsanitize=address on > GCC 7. Good catch. However, it may make more sense to switch to using the "args" field instead of the "argv" field: it is of type "struct argv_array" and is released automagically by finish_command(). In other words, you would use something like @@ -600,7 +601,8 @@ static struct cmd2process *start_multi_file_filter(struct hashmap *hashmap, cons process = &entry->process; child_process_init(process); - process->argv = argv; + argv_array_push(&process->args, cmd); instead, making even for a nice LOC reduction. Ciao, Johannes