On Thu, 28 Mar 2013 18:46:27 +0100, Diego Biurrun <[email protected]> wrote: > On Thu, Mar 28, 2013 at 07:54:33AM +0100, Anton Khirnov wrote: > > --- a/libavutil/opt.c > > +++ b/libavutil/opt.c > > @@ -562,9 +562,16 @@ static int parse_key_value_pair(void *ctx, const char > > **buf, > > char *val; > > int ret; > > > > + if (!key) > > + return AVERROR(ENOMEM); > > + > > if (*key && strspn(*buf, key_val_sep)) { > > (*buf)++; > > val = av_get_token(buf, pairs_sep); > > + if (!val) { > > + av_freep(&key); > > + return AVERROR(ENOMEM); > > + } > > } else { > > av_log(ctx, AV_LOG_ERROR, "Missing key or no key/value separator > > found after key '%s'\n", key); > > av_free(key); > > I wonder about av_free(key) vs. av_freep(&key). >
No practical difference in this keys. I just prefer to use av_freep everywhere because of potential advantages and no drawbacks. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
