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).

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

Reply via email to