[x265] [PATCH] threadpool: fix memory leak

Aruna Matheswaran aruna at multicorewareinc.com
Fri Jul 21 21:09:52 CEST 2017


Ooops! Thanks for catching this! I'll resend it.

On Fri, Jul 21, 2017 at 11:04 PM, Andrey Semashev <andrey.semashev at gmail.com
> wrote:

> On 07/21/17 09:29, aruna at multicorewareinc.com wrote:
>
>> # HG changeset patch
>> # User Aruna Matheswaran <aruna at multicorewareinc.com>
>> # Date 1500457328 -19800
>> #      Wed Jul 19 15:12:08 2017 +0530
>> # Branch stable
>> # Node ID fd354d5ec1328a000c24e1551804a1ce569ec3b0
>> # Parent  adbcc90bdef36b50a091deb5b0d0ad77debfbee7
>> threadpool: fix memory leak
>>
>> diff -r adbcc90bdef3 -r fd354d5ec132 source/common/threadpool.cpp
>> --- a/source/common/threadpool.cpp      Thu Jul 13 16:50:18 2017 +0530
>> +++ b/source/common/threadpool.cpp      Wed Jul 19 15:12:08 2017 +0530
>> @@ -454,6 +454,7 @@
>>                       if ((nodeMaskPerPool[node] >> j) & 1)
>>                           len += sprintf(nodesstr + len, ",%d", j);
>>                   x265_log(p, X265_LOG_INFO, "Thread pool %d using %d
>> threads on numa nodes %s\n", i, numThreads, nodesstr + 1);
>> +                free(nodesstr);
>>
>
> This applies free() to a pointer obtained with new[]. It should be
> delete[] or better yet - replace the original new with a buffer on the
> stack.
>
>               }
>>               else
>>                   x265_log(p, X265_LOG_INFO, "Thread pool created using
>> %d threads\n", numThreads);
>>
>> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20170722/0327feab/attachment.html>


More information about the x265-devel mailing list