aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Screen.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-06-17 23:37:51 +0200
committerUlrich Sibiller <uli42@gmx.de>2019-06-19 00:49:57 +0200
commit7564422263a10ec8992e538bb741b2ddb51dad82 (patch)
tree424ed41f6d4f66d9eea06a26c0d1e260ef79b7b1 /nx-X11/programs/Xserver/hw/nxagent/Screen.c
parent4dd1f3cbdff984ff55bc2f88c64b2544c8d88148 (diff)
downloadnx-libs-7564422263a10ec8992e538bb741b2ddb51dad82.tar.gz
nx-libs-7564422263a10ec8992e538bb741b2ddb51dad82.tar.bz2
nx-libs-7564422263a10ec8992e538bb741b2ddb51dad82.zip
Screen.c: fix another memory leak
==12280== 0 bytes in 5 blocks are definitely lost in loss record 1 of 304 ==12280== at 0x483577F: malloc (vg_replace_malloc.c:299) ==12280== by 0x2EFC29: init_visuals (xf86glx.c:489) ==12280== by 0x2EFC29: __MESA_initVisuals (xf86glx.c:540) ==12280== by 0x17C902: GlxInitVisuals (glxext.c:317) ==12280== by 0x218C03: fbInitVisuals (fbcmap.c:668) ==12280== by 0x20BC41: fbFinishScreenInit (fbscreen.c:229) ==12280== by 0x20C005: fbScreenInit (fbscreen.c:273) ==12280== by 0x1E024C: nxagentOpenScreen (Screen.c:1356) ==12280== by 0x16D828: AddScreen (dispatch.c:4171) ==12280== by 0x1DB7DF: InitOutput (Init.c:396) ==12280== by 0x14DB12: main (main.c:279) ==12280== ==12280== 64 bytes in 2 blocks are definitely lost in loss record 223 of 304 ==12280== at 0x483577F: malloc (vg_replace_malloc.c:299) ==12280== by 0x2EFA05: init_visuals (xf86glx.c:489) ==12280== by 0x2EFA05: __MESA_initVisuals (xf86glx.c:540) ==12280== by 0x17C902: GlxInitVisuals (glxext.c:317) ==12280== by 0x218C03: fbInitVisuals (fbcmap.c:668) ==12280== by 0x20BC41: fbFinishScreenInit (fbscreen.c:229) ==12280== by 0x20C005: fbScreenInit (fbscreen.c:273) ==12280== by 0x1E024C: nxagentOpenScreen (Screen.c:1356) ==12280== by 0x16D828: AddScreen (dispatch.c:4171) ==12280== by 0x1DB7DF: InitOutput (Init.c:396) ==12280== by 0x14DB12: main (main.c:279)
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Screen.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 84ef9c4a4..2fcb741db 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -1391,15 +1391,23 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* by fbScreenInit with our own.
*/
- free(pScreen -> visuals);
+ for (int i = 0; i < pScreen->numDepths; i++)
+ {
+ #ifdef DEBUG
+ fprintf(stderr, "%s: depth [%d] index [%d] vids [%p]\n", __func__, pScreen->allowedDepths[i].depth, i, (void*) pScreen->allowedDepths[i].vids);
+ #endif
+ free(pScreen->allowedDepths[i].vids);
+ }
+
free(pScreen -> allowedDepths);
+ pScreen -> allowedDepths = depths;
+ pScreen -> numDepths = numDepths;
+ pScreen -> rootDepth = rootDepth;
+ free(pScreen -> visuals);
pScreen -> visuals = visuals;
- pScreen -> allowedDepths = depths;
pScreen -> numVisuals = numVisuals;
- pScreen -> numDepths = numDepths;
pScreen -> rootVisual = defaultVisual;
- pScreen -> rootDepth = rootDepth;
/*
* Set up the internal structures used for