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
cdaec755
Commit
cdaec755
authored
Dec 05, 2017
by
Ulrich Sibiller
Committed by
Mihai Moldovan
Dec 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure XQueryTree results are freed
Fixes ArcticaProject/nx-libs#585
parent
0938cf83
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
22 deletions
+24
-22
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+17
-15
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+1
-1
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+6
-6
No files found.
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
cdaec755
...
...
@@ -426,13 +426,12 @@ void nxagentRemoteWindowsTree(Window window, int level)
int
i
,
j
;
unsigned
long
rootWin
,
parentWin
;
unsigned
int
numChildren
;
unsigned
long
*
childList
;
unsigned
long
*
childList
=
NULL
;
if
(
!
XQueryTree
(
nxagentDisplay
,
window
,
&
rootWin
,
&
parentWin
,
&
childList
,
&
numChildren
))
{
fprintf
(
stderr
,
"nxagentRemoteWindowsTree - XQueryTree failed.
\n
"
);
return
;
}
...
...
@@ -3185,7 +3184,7 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X)
#endif
}
if
(
result
&&
n
children_return
)
if
(
children_return
)
{
XFree
(
children_return
);
}
...
...
@@ -3540,6 +3539,12 @@ int nxagentHandleReparentNotify(XEvent* X)
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
root_return
,
&
parent_return
,
&
children_return
,
&
nchildren_return
);
if
(
children_return
)
{
XFree
(
children_return
);
children_return
=
NULL
;
}
if
(
!
result
)
{
#ifdef WARNING
...
...
@@ -3548,11 +3553,6 @@ int nxagentHandleReparentNotify(XEvent* X)
break
;
}
if
(
result
&&
children_return
)
{
XFree
(
children_return
);
}
}
if
(
w
&&
!
nxagentWindowPtr
(
w
))
...
...
@@ -3581,9 +3581,10 @@ int nxagentHandleReparentNotify(XEvent* X)
#endif
}
if
(
result
&&
n
children_return
)
if
(
children_return
)
{
XFree
(
children_return
);
children_return
=
NULL
;
}
}
else
...
...
@@ -3647,17 +3648,18 @@ int nxagentHandleReparentNotify(XEvent* X)
{
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
rootReturn
,
&
parentReturn
,
&
childrenReturn
,
&
nchildrenReturn
);
if
(
parentReturn
==
rootReturn
||
parentReturn
==
0
||
result
==
0
)
if
(
childrenReturn
)
{
break
;
XFree
(
childrenReturn
);
childrenReturn
=
NULL
;
}
if
(
result
==
1
&&
childrenReturn
!=
NULL
)
if
(
parentReturn
==
rootReturn
||
parentReturn
==
0
||
result
==
0
)
{
XFree
(
childrenReturn
)
;
break
;
}
w
=
parentReturn
;
}
while
(
True
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
cdaec755
...
...
@@ -249,7 +249,7 @@ Bool nxagentRootlessTreesMatch()
{
Window
root_return
;
Window
parent_return
;
Window
*
children_return
;
Window
*
children_return
=
NULL
;
unsigned
int
nChildrenReturn
;
WindowPtr
pTestWin
=
screenInfo
.
screens
[
0
]
->
root
->
firstChild
;
Bool
treesMatch
=
True
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
cdaec755
...
...
@@ -1454,7 +1454,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
{
Window
root_return
;
Window
parent_return
;
Window
*
children_return
;
Window
*
children_return
=
NULL
;
unsigned
int
nchildren_return
;
Status
result
;
...
...
@@ -1473,16 +1473,16 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
}
}
fprintf
(
stderr
,
"
\n
"
);
if
(
children_return
)
{
XFree
(
children_return
);
}
}
else
{
fprintf
(
stderr
,
"nxagentConfigureWindow: Failed QueryTree request.
\n
"
);
}
if
(
children_return
)
{
XFree
(
children_return
);
}
}
#endif
}
...
...
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