Commit 75644222 authored by Ulrich Sibiller's avatar Ulrich Sibiller

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)
parent 4dd1f3cb
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment