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
a83022a4
Commit
a83022a4
authored
Dec 14, 2016
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rootless.c: improve malloc failure handling
parent
4e545710
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+34
-2
No files found.
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
a83022a4
...
...
@@ -315,6 +315,13 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
Mask
mask
;
toplevel
=
malloc
(
sizeof
(
WindowPtr
)
*
nchildren
);
if
(
!
toplevel
)
{
/* FIXME: Is this too much and we and simply return here? */
FatalError
(
"nxagentRootlessRestack: malloc() failed."
);
}
ntoplevel
=
0
;
for
(
i
=
0
;
i
<
nchildren
;
i
++
)
...
...
@@ -497,6 +504,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
#ifdef _XSERVER64
else
if
(
strcmp
(
typeS
,
"CARDINAL"
)
==
0
||
strcmp
(
typeS
,
"WM_SIZE_HINTS"
)
==
0
)
{
/* FIXME: is it okay here to ignore malloc fails? */
unsigned
long
*
buffer
=
malloc
(
nUnits
*
sizeof
(
*
buffer
));
int
*
input
=
value
;
int
i
;
...
...
@@ -640,6 +648,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
int
i
;
int
j
=
0
;
if
(
!
atoms
)
{
#ifdef WARNING
fprintf
(
stderr
,
"nxagentExportProperty: WARNING! malloc() failed for '%s'- bailing out.
\n
"
,
typeS
);
#endif
return
False
;
}
freeMem
=
True
;
export
=
True
;
output
=
(
char
*
)
atoms
;
...
...
@@ -690,6 +706,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
WindowPtr
pWindow
;
int
i
;
if
(
!
wind
)
{
#ifdef WARNING
fprintf
(
stderr
,
"nxagentExportProperty: WARNING! malloc() failed for '%s' - bailing out.
\n
"
,
typeS
);
#endif
return
False
;
}
freeMem
=
True
;
export
=
True
;
output
=
(
char
*
)
wind
;
...
...
@@ -1037,7 +1061,7 @@ void nxagentImportProperty(Window window,
if
(
atoms
==
NULL
)
{
#ifdef WARNING
fprintf
(
stderr
,
"nxagentImportProperty: WARNING!
Malloc failed bailing out.
\n
"
);
fprintf
(
stderr
,
"nxagentImportProperty: WARNING!
malloc() failed for '%s' - bailing out.
\n
"
,
typeS
);
#endif
return
;
...
...
@@ -1067,6 +1091,14 @@ void nxagentImportProperty(Window window,
WindowPtr
pWindow
;
int
i
;
if
(
!
wind
)
{
#ifdef WARNING
fprintf
(
stderr
,
"nxagentImportProperty: WARNING! malloc() failed for '%s' - bailing out.
\n
"
,
typeS
);
#endif
return
;
}
freeMem
=
True
;
import
=
True
;
output
=
(
char
*
)
wind
;
...
...
@@ -1185,7 +1217,7 @@ void nxagentAddPropertyToList(Atom property, WindowPtr pWin)
if
((
tmp
=
malloc
(
sizeof
(
struct
nxagentPropertyRec
)))
==
NULL
)
{
FatalError
(
"nxagentAddPropertyToList: malloc failed."
);
FatalError
(
"nxagentAddPropertyToList: malloc
()
failed."
);
}
#ifdef TEST
...
...
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