> -----Original Message-----
> From: Peng, ZhihongX <[email protected]>
> Sent: Friday, September 17, 2021 10:15 AM
> To: [email protected]; [email protected]
> Cc: [email protected]; Peng, ZhihongX <[email protected]>;
> [email protected]
> Subject: [PATCH v2 1/2] lib/cmdline: release cl when cmdline exit
> 
> From: Zhihong Peng <[email protected]>
> 
> Malloc cl in the cmdline_stdin_new function, so release in the
> cmdline_stdin_exit function is logical, so that cl will not be released alone.
> 
> Fixes: af75078fece3 (first public release)
> Cc: [email protected]
> 
> Signed-off-by: Zhihong Peng <[email protected]>
> ---
>  lib/cmdline/cmdline_socket.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/cmdline/cmdline_socket.c b/lib/cmdline/cmdline_socket.c
> index 998e8ade25..ebd5343754 100644
> --- a/lib/cmdline/cmdline_socket.c
> +++ b/lib/cmdline/cmdline_socket.c
> @@ -53,4 +53,5 @@ cmdline_stdin_exit(struct cmdline *cl)
>               return;
> 
>       terminal_restore(cl);
> +     cmdline_free(cl);
>  }
> --
> 2.25.1

Tested-by: Zhihong Peng <[email protected]>

Reply via email to