[X2Go-Commits] [nx-libs] 86/219: glxext.c: fix another memory leak

git-admin at x2go.org git-admin at x2go.org
Sat Sep 28 12:10:27 CEST 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit bffdacc48a6bd49e4ac1b4ce5d2fcc8eecdb811c
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Tue Jun 18 23:36:45 2019 +0200

    glxext.c: fix another memory leak
    
    ==10226== 3,337 bytes in 1 blocks are definitely lost in loss record 295 of 307
    ==10226==    at 0x483577F: malloc (vg_replace_malloc.c:299)
    ==10226==    by 0x6281DB9: strdup (strdup.c:42)
    ==10226==    by 0x2ABA9E: __glXClientInfo (glxcmds.c:2170)
    ==10226==    by 0x17CA3E: __glXDispatch (NXglxext.c:128)
    ==10226==    by 0x16EE77: Dispatch (NXdispatch.c:476)
    ==10226==    by 0x14DCE0: main (main.c:353)
    
    There's no point in trying to free cl->* after memset(0).
    
    This one is a bug that is found identically in xorg upstream and has
    only been fixed during rework of the whole client resource freeing
    stuff. So we fix it in glxext.c.
---
 nx-X11/programs/Xserver/GL/glx/glxext.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.c b/nx-X11/programs/Xserver/GL/glx/glxext.c
index e92e605fa..4f2d2082d 100644
--- a/nx-X11/programs/Xserver/GL/glx/glxext.c
+++ b/nx-X11/programs/Xserver/GL/glx/glxext.c
@@ -64,6 +64,7 @@ static void ResetClientState(int clientIndex)
     if (cl->returnBuf) free(cl->returnBuf);
     if (cl->largeCmdBuf) free(cl->largeCmdBuf);
     if (cl->currentContexts) free(cl->currentContexts);
+    if (cl->GLClientextensions) free(cl->GLClientextensions);
     memset(cl, 0, sizeof(__GLXclientState));
     /*
     ** By default, assume that the client supports
@@ -71,9 +72,6 @@ static void ResetClientState(int clientIndex)
     */
     cl->GLClientmajorVersion = 1;
     cl->GLClientminorVersion = 0;
-    if (cl->GLClientextensions)
-	free(cl->GLClientextensions);
-
 }
 
 /*

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list