Re: [PATCH v5 6/8] convert: rename reusable sub-process functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 07 Apr 2017, at 14:03, Ben Peart <peartben@xxxxxxxxx> wrote:
> 
> Do a mechanical rename of the functions that will become the reusable
> sub-process module.
> 
> Signed-off-by: Ben Peart <benpeart@xxxxxxxxxxxxx>
> ---
> convert.c | 53 +++++++++++++++++++++++++++--------------------------
> 1 file changed, 27 insertions(+), 26 deletions(-)
> 
> diff --git a/convert.c b/convert.c
> index 747c0c363b..235a6a5279 100644
> --- a/convert.c
> +++ b/convert.c
> @@ -507,8 +507,8 @@ struct cmd2process {
> 	unsigned int supported_capabilities;
> };
> 

> ...

> 
> -static void kill_multi_file_filter(struct subprocess_entry *entry)
> +static void subprocess_stop(struct subprocess_entry *entry)
> {
> 	if (!entry)
> 		return;
> @@ -561,14 +561,14 @@ static void kill_multi_file_filter(struct subprocess_entry *entry)
> 	kill(entry->process.pid, SIGTERM);
> 	finish_command(&entry->process);
> 
> -	hashmap_remove(&cmd_process_map, entry, NULL);
> +	hashmap_remove(&subprocess_map, entry, NULL);
> 	free(entry);
> }

> ...

> @@ -777,7 +777,8 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len
> 			 * Force shutdown and restart if another blob requires filtering.
> 			 */
> 			error("external filter '%s' failed", cmd);
> -			kill_multi_file_filter((struct subprocess_entry *)entry);
> +			subprocess_stop((struct subprocess_entry *)entry);
> +			free(entry);

I think we perform a double "free" here and in subprocess_stop(), no?
Everything else looks good to me!

Thanks,
Lars



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]