[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] expr: plug a memory leak in eval6()
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] expr: plug a memory leak in eval6() |
Date: |
Wed, 30 Aug 2017 11:52:40 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 30/08/17 04:50, Kamil Dudka wrote:
> * src/expr.c (eval6): Free memory allocated by mbs_logical_substr().
>
> Introduced in v8.27-47-ga9f2be5. Detected by Coverity Analysis:
> src/expr.c:851: leaked_storage: Variable "s" going out of scope leaks the
> storage it points to.
> 849| char *s = mbs_logical_substr (l->u.s, pos, len);
> 850| v = str_value (s);
> 851|-> }
> 852| freev (l);
> 853| freev (i1);
> ---
> src/expr.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/expr.c b/src/expr.c
> index 795140c..0f6f87a 100644
> --- a/src/expr.c
> +++ b/src/expr.c
> @@ -848,6 +848,7 @@ eval6 (bool evaluate)
>
> char *s = mbs_logical_substr (l->u.s, pos, len);
> v = str_value (s);
> + free(s);
> }
> freev (l);
> freev (i1);
> -- 2.9.5
Excellent.
Applied
Thank you!
- Re: [platform-testers] new snapshot available: coreutils-8.27.99-3ebdc3, (continued)
new snapshot available: coreutils-8.27.103-db8d1, Pádraig Brady, 2017/08/30
- Re: new snapshot available: coreutils-8.27.103-db8d1, Erik Auerswald, 2017/08/30
- [PATCH] expr: plug a memory leak in eval6(), Kamil Dudka, 2017/08/30
- Re: [PATCH] expr: plug a memory leak in eval6(),
Pádraig Brady <=
- Re: new snapshot available: coreutils-8.27.103-db8d1, Assaf Gordon, 2017/08/30
- Re: new snapshot available: coreutils-8.27.103-db8d1, Eric Blake, 2017/08/31
- Re: new snapshot available: coreutils-8.27.103-db8d1, Pádraig Brady, 2017/08/31
new snapshot available: coreutils-8.27.108-2ba96, Pádraig Brady, 2017/08/31