Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
d8012d2a
Commit
d8012d2a
authored
Jul 22, 2019
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Screen.c: safe some lines by calling SAFE_XFree
parent
ebc2ea79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
44 deletions
+29
-44
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+29
-44
No files found.
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
d8012d2a
...
...
@@ -304,8 +304,7 @@ Bool nxagentIsParentOf(Display *d, XlibWindow possible_parent, XlibWindow candid
if
(
XQueryTree
(
d
,
candidate
,
&
root
,
&
parent
,
&
children
,
&
num_children
))
{
if
(
children
)
XFree
((
char
*
)
children
);
SAFE_XFree
(
children
);
#ifdef TEST
fprintf
(
stderr
,
"%s: parent of full screen window [%p] root [%p] possible_parent [%p] candidate [%p]
\n
"
,
__func__
,
parent
,
root
,
possible_parent
,
candidate
);
...
...
@@ -490,11 +489,8 @@ Window nxagentCreateIconWindow(void)
window_name
,
window_name
,
NULL
,
0
,
sizeHints
,
wmHints
,
NULL
);
if
(
sizeHints
)
XFree
(
sizeHints
);
if
(
wmHints
)
XFree
(
wmHints
);
SAFE_XFree
(
sizeHints
);
SAFE_XFree
(
wmHints
);
/*
* Enable events from the icon window.
...
...
@@ -895,10 +891,9 @@ void freeDepths(DepthPtr depths, int num)
#ifdef DEBUG
fprintf
(
stderr
,
"%s: freeing depth [%d] index [%d] vids [%p]
\n
"
,
__func__
,
depths
[
i
].
depth
,
i
,
(
void
*
)
depths
[
i
].
vids
);
#endif
free
(
depths
[
i
].
vids
);
depths
[
i
].
vids
=
NULL
;
SAFE_free
(
depths
[
i
].
vids
);
}
free
(
depths
);
SAFE_
free
(
depths
);
}
Bool
nxagentOpenScreen
(
ScreenPtr
pScreen
,
...
...
@@ -1393,7 +1388,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
if
(
!
pFrameBufferBits
)
{
freeDepths
(
depths
,
numDepths
);
free
(
visuals
);
SAFE_
free
(
visuals
);
return
FALSE
;
}
...
...
@@ -1416,7 +1411,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
monitorResolution
,
monitorResolution
,
PixmapBytePad
(
nxagentOption
(
RootWidth
),
rootDepth
),
bitsPerPixel
))
{
freeDepths
(
depths
,
numDepths
);
free
(
visuals
);
SAFE_
free
(
visuals
);
return
FALSE
;
}
...
...
@@ -1457,7 +1452,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
pScreen
->
numDepths
=
numDepths
;
pScreen
->
rootDepth
=
rootDepth
;
free
(
pScreen
->
visuals
);
SAFE_
free
(
pScreen
->
visuals
);
pScreen
->
visuals
=
visuals
;
pScreen
->
numVisuals
=
numVisuals
;
pScreen
->
rootVisual
=
defaultVisual
;
...
...
@@ -1898,8 +1893,8 @@ N/A
hint
.
res_class
=
strdup
(
"NXAgent"
);
}
XSetClassHint
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
&
hint
);
free
(
hint
.
res_name
);
free
(
hint
.
res_class
);
SAFE_
free
(
hint
.
res_name
);
SAFE_
free
(
hint
.
res_class
);
}
if
(
nxagentOption
(
Fullscreen
))
...
...
@@ -1983,17 +1978,8 @@ N/A
nxagentWindowName
,
argv
,
argc
,
sizeHints
,
wmHints
,
NULL
);
if
(
sizeHints
)
{
XFree
(
sizeHints
);
sizeHints
=
NULL
;
}
if
(
wmHints
)
{
XFree
(
wmHints
);
wmHints
=
NULL
;
}
SAFE_XFree
(
sizeHints
);
SAFE_XFree
(
wmHints
);
/*
* Clear the window but let it unmapped. We'll map it
...
...
@@ -2205,9 +2191,9 @@ Bool nxagentCloseScreen(ScreenPtr pScreen)
* Free the frame buffer.
*/
free
(((
PixmapPtr
)
pScreen
->
devPrivate
)
->
devPrivate
.
ptr
);
free
(
pScreen
->
devPrivate
);
pScreen
->
devPrivate
=
NULL
;
free
(
pScreen
->
visuals
);
pScreen
->
visuals
=
NULL
;
SAFE_
free
(((
PixmapPtr
)
pScreen
->
devPrivate
)
->
devPrivate
.
ptr
);
SAFE_free
(
pScreen
->
devPrivate
)
;
SAFE_free
(
pScreen
->
visuals
)
;
fbCloseScreen
(
pScreen
);
...
...
@@ -3167,7 +3153,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
length
=
nxagentImageLength
(
width
,
height
,
ZPixmap
,
0
,
nxagentMasterDepth
);
free
(
tBuffer
);
SAFE_
free
(
tBuffer
);
tBuffer
=
malloc
(
length
);
...
...
@@ -3224,7 +3210,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
RegionUnion
(
&
nxagentShadowUpdateRegion
,
&
nxagentShadowUpdateRegion
,
&
updateRegion
);
}
free
(
tBuffer
);
SAFE_
free
(
tBuffer
);
RegionUninit
(
&
updateRegion
);
}
...
...
@@ -3442,7 +3428,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
cBuffer
=
(
unsigned
char
*
)
*
buffer
;
*
buffer
=
(
char
*
)
icBuffer
;
free
(
cBuffer
);
SAFE_
free
(
cBuffer
);
}
#ifdef NXAGENT_ARTSD
...
...
@@ -3625,7 +3611,7 @@ FIXME: The port information is not used at the moment and produces a
strlen
(
local_buf
),
local_buf
,
1
);
}
free
(
local_buf
);
SAFE_
free
(
local_buf
);
}
}
}
...
...
@@ -4049,7 +4035,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
#endif
number
=
1
;
free
(
screeninfo
);
SAFE_
free
(
screeninfo
);
if
(
!
(
screeninfo
=
malloc
(
sizeof
(
XineramaScreenInfo
))))
{
return
FALSE
;
...
...
@@ -4318,8 +4304,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
}
/* release allocated memory */
free
(
screeninfo
);
screeninfo
=
NULL
;
SAFE_free
(
screeninfo
);
#ifdef DEBUG
for
(
i
=
0
;
i
<
pScrPriv
->
numCrtcs
;
i
++
)
{
...
...
@@ -4434,7 +4419,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
XSetClipRectangles
(
nxagentDisplay
,
gc
,
0
,
0
,
pRects
,
nRects
,
Unsorted
);
free
((
char
*
)
pRects
);
SAFE_free
(
pRects
);
extents
=
*
RegionExtents
(
&
cleanRegion
);
...
...
@@ -4580,7 +4565,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
XSetClipRectangles
(
nxagentDisplay
,
gc
,
0
,
0
,
pRects
,
nRects
,
Unsorted
);
free
(
pRects
);
SAFE_
free
(
pRects
);
extents
=
*
RegionExtents
(
clipRegion
);
...
...
@@ -4660,7 +4645,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
screen
],
sizeHints
);
XFree
(
sizeHints
);
SAFE_
XFree
(
sizeHints
);
}
/*
...
...
@@ -4679,7 +4664,7 @@ void nxagentSetWMNormalHintsMaxsize(ScreenPtr pScreen, int maxwidth, int maxheig
sizeHints
->
max_height
=
maxheight
;
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
sizeHints
);
XFree
(
sizeHints
);
SAFE_
XFree
(
sizeHints
);
}
}
...
...
@@ -4820,7 +4805,7 @@ FIXME
fprintf
(
stderr
,
"nxagentShowPixmap: XGetImage failed.
\n
"
);
#endif
free
(
data
);
SAFE_
free
(
data
);
return
;
}
...
...
@@ -4853,7 +4838,7 @@ FIXME
XDestroyImage
(
image
);
}
free
(
data
);
SAFE_
free
(
data
);
/*
FIXME
...
...
@@ -4905,7 +4890,7 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc,
fprintf
(
stderr
,
"nxagentFbRestoreArea: XGetImage failed.
\n
"
);
#endif
free
(
data
);
SAFE_
free
(
data
);
return
;
}
...
...
@@ -4965,7 +4950,7 @@ FIXME
/*
FIXME
free(data);
SAFE_
free(data);
*/
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment