nsc: Fix memory leak
authorPascal Nowack <Pascal.Nowack@gmx.de>
Fri, 26 Jun 2020 14:33:19 +0000 (16:33 +0200)
committerakallabeth <akallabeth@posteo.net>
Mon, 29 Jun 2020 06:13:05 +0000 (08:13 +0200)
Fixes the following memory leak:

==115716== 16,662,960 bytes in 459 blocks are definitely lost in loss record 3,504 of 3,504
==115716==    at 0x48396AF: malloc (vg_replace_malloc.c:306)
==115716==    by 0x4C6A4E2: nsc_context_initialize_encode (nsc_encode.c:77)
==115716==    by 0x4C6A4E2: nsc_compose_message (nsc_encode.c:497)

(cherry picked from commit 9bd457405095c94a24175bc54bd99947fcf6a33d)

libfreerdp/codec/nsc.c

index 6627e0b..dc3a978 100644 (file)
@@ -364,7 +364,7 @@ void nsc_context_free(NSC_CONTEXT* context)
 
        if (context->priv)
        {
-               for (i = 0; i < 4; i++)
+               for (i = 0; i < 5; i++)
                        free(context->priv->PlaneBuffers[i]);
 
                nsc_profiler_print(context->priv);