On Wed, 15 May 2013 11:17:02 +0300 (EEST), Martin Storsjö <[email protected]> 
wrote:
> On Tue, 30 Apr 2013, Anton Khirnov wrote:
> 
> > Do not leak the expressions.
> > ---
> > libavfilter/vf_lut.c |    1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
> > index c8cf1b7..526370e 100644
> > --- a/libavfilter/vf_lut.c
> > +++ b/libavfilter/vf_lut.c
> > @@ -244,6 +244,7 @@ static int config_props(AVFilterLink *inlink)
> >         double res;
> >
> >         /* create the parsed expression */
> > +        av_expr_free(s->comp_expr[comp]);
> >         ret = av_expr_parse(&s->comp_expr[comp], s->comp_expr_str[comp],
> >                             var_names, funcs1_names, funcs1, NULL, NULL, 0, 
> > ctx);
> >         if (ret < 0) {
> > -- 
> > 1.7.10.4
> 
> Would it be needed to set it to null after freeing as well, to avoid 
> potential double freeing?

Hmm, I guess av_expr_parse doesn't guarantee that it's set to NULL on failure,
so this would be a good idea.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to