Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH 12/17: typeset: fix leak of oldval



On Tue, 6 Jan 2015 06:25:44 +0100
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> Found by Coverity (Issue 1255803).
> ---
>  Src/builtin.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Src/builtin.c b/Src/builtin.c
> index ae7f53b..38d34ae 100644
> --- a/Src/builtin.c
> +++ b/Src/builtin.c
> @@ -2510,6 +2510,8 @@ bin_typeset(char *name, char **argv, Options ops, int func)
>  							  asg->name),
>  				 func, (on | PM_ARRAY) & ~PM_EXPORTED,
>  				 off, roff, asg->value, NULL, ops, 0))) {
> +	    if (oldval)
> +		zsfree(oldval);
>  	    unqueue_signals();
>  	    return 1;
>  	}

That's certainly logical --- couldn't be worse than harmless even if
there's something very strange going on.

pws



Messages sorted by: Reverse Date, Date, Thread, Author