Skip to content
Snippets Groups Projects
Commit 64327226 authored by Jeremy Huddleston Sequoia's avatar Jeremy Huddleston Sequoia
Browse files

XQuartz: Silence a clang static analysis warning about a memory leak


It seems the alanyzer can't comprehend dixSetPrivate().

quartz.c:119:12: warning: Potential leak of memory pointed to by 'displayInfo'
    return quartzProcs->AddScreen(index, pScreen);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
parent b2f6b349
No related branches found
No related tags found
No related merge requests found
......@@ -109,11 +109,14 @@ Bool
QuartzAddScreen(int index,
ScreenPtr pScreen)
{
// The clang static analyzer thinks we leak displayInfo here
#ifndef __clang_analyzer__
// allocate space for private per screen Quartz specific storage
QuartzScreenPtr displayInfo = calloc(sizeof(QuartzScreenRec), 1);
// QUARTZ_PRIV(pScreen) = displayInfo;
dixSetPrivate(&pScreen->devPrivates, quartzScreenKey, displayInfo);
#endif /* __clang_analyzer__ */
// do Quartz mode specific initialization
return quartzProcs->AddScreen(index, pScreen);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment