[x265] [PATCH] encoder: fix memory leak in param if fail to open encoder

Steve Borho steve at borho.org
Wed Aug 13 22:17:02 CEST 2014


On 08/13, aarthi at multicorewareinc.com wrote:
> # HG changeset patch
> # User Aarthi Thirumalai
> # Date 1407925504 -19800
> #      Wed Aug 13 15:55:04 2014 +0530
> # Node ID 4aed508841e9abfb861093420d76ff99c5487b7a
> # Parent  e13e1da57d203de93d44c0e432b490cad1bf0795
> encoder: fix memory leak in param if fail to open encoder.
> 
> diff -r e13e1da57d20 -r 4aed508841e9 source/x265.cpp
> --- a/source/x265.cpp	Wed Aug 13 15:53:00 2014 +0530
> +++ b/source/x265.cpp	Wed Aug 13 15:55:04 2014 +0530
> @@ -784,6 +784,7 @@
>      {
>          x265_log(param, X265_LOG_ERROR, "failed to open encoder\n");
>          cliopt.destroy();
> +        X265_FREE(param);

nice catch, but param is allocated from the library and needs to be
freed with x265_param_free(param), and there's a similar early out just
above this one that is missing the same free

-- 
Steve Borho


More information about the x265-devel mailing list