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
b8411180
Commit
b8411180
authored
Jul 22, 2019
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display.c: safe some lines by calling SAFE_XFree and SAFE_free
parent
1330167f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
49 deletions
+16
-49
Display.c
nx-X11/programs/Xserver/hw/nxagent/Display.c
+16
-49
No files found.
nx-X11/programs/Xserver/hw/nxagent/Display.c
View file @
b8411180
...
@@ -71,6 +71,7 @@ is" without express or implied warranty.
...
@@ -71,6 +71,7 @@ is" without express or implied warranty.
#include "Init.h"
#include "Init.h"
#include "Args.h"
#include "Args.h"
#include "Image.h"
#include "Image.h"
#include "Utils.h"
#define Pixmap XlibPixmap
#define Pixmap XlibPixmap
#include "Icons.h"
#include "Icons.h"
...
@@ -1543,7 +1544,7 @@ void nxagentInitVisuals(void)
...
@@ -1543,7 +1544,7 @@ void nxagentInitVisuals(void)
nxagentNumVisuals
*
sizeof
(
XVisualInfo
));
nxagentNumVisuals
*
sizeof
(
XVisualInfo
));
}
}
XFree
(
viList
);
SAFE_
XFree
(
viList
);
if
(
nxagentNumVisuals
==
0
||
nxagentVisuals
==
NULL
)
if
(
nxagentNumVisuals
==
0
||
nxagentVisuals
==
NULL
)
{
{
...
@@ -1765,20 +1766,11 @@ void nxagentCloseDisplay(void)
...
@@ -1765,20 +1766,11 @@ void nxagentCloseDisplay(void)
* traffic
* traffic
*/
*/
free
(
nxagentDefaultColormaps
);
SAFE_free
(
nxagentDefaultColormaps
);
nxagentDefaultColormaps
=
NULL
;
SAFE_free
(
nxagentDepths
);
SAFE_XFree
(
nxagentVisuals
);
XFree
(
nxagentVisuals
);
SAFE_XFree
(
nxagentPixmapFormats
);
nxagentVisuals
=
NULL
;
SAFE_XFree
(
nxagentRemotePixmapFormats
);
free
(
nxagentDepths
);
nxagentDepths
=
NULL
;
XFree
(
nxagentPixmapFormats
);
nxagentPixmapFormats
=
NULL
;
XFree
(
nxagentRemotePixmapFormats
);
nxagentRemotePixmapFormats
=
NULL
;
nxagentFreeFontCache
();
nxagentFreeFontCache
();
/*
/*
...
@@ -2017,11 +2009,7 @@ void nxagentBackupDisplayInfo(void)
...
@@ -2017,11 +2009,7 @@ void nxagentBackupDisplayInfo(void)
nxagentNumDefaultColormapsRecBackup
=
nxagentNumDefaultColormaps
;
nxagentNumDefaultColormapsRecBackup
=
nxagentNumDefaultColormaps
;
nxagentVisualsRecBackup
=
nxagentVisuals
;
nxagentVisualsRecBackup
=
nxagentVisuals
;
nxagentNumVisualsRecBackup
=
nxagentNumVisuals
;
nxagentNumVisualsRecBackup
=
nxagentNumVisuals
;
if
(
nxagentVisualHasBeenIgnored
)
SAFE_free
(
nxagentVisualHasBeenIgnored
);
{
free
(
nxagentVisualHasBeenIgnored
);
nxagentVisualHasBeenIgnored
=
NULL
;
}
nxagentVisualHasBeenIgnored
=
malloc
(
nxagentNumVisuals
*
sizeof
(
Bool
));
nxagentVisualHasBeenIgnored
=
malloc
(
nxagentNumVisuals
*
sizeof
(
Bool
));
nxagentDefaultDepthRecBackup
=
DefaultDepth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
nxagentDefaultDepthRecBackup
=
DefaultDepth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
nxagentDisplayWidthRecBackup
=
DisplayWidth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
nxagentDisplayWidthRecBackup
=
DisplayWidth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
...
@@ -2033,20 +2021,11 @@ void nxagentBackupDisplayInfo(void)
...
@@ -2033,20 +2021,11 @@ void nxagentBackupDisplayInfo(void)
void
nxagentCleanupBackupDisplayInfo
(
void
)
void
nxagentCleanupBackupDisplayInfo
(
void
)
{
{
free
(
nxagentDepthsRecBackup
);
SAFE_free
(
nxagentDepthsRecBackup
);
nxagentNumDepthsRecBackup
=
0
;
SAFE_free
(
nxagentVisualsRecBackup
);
SAFE_free
(
nxagentVisualHasBeenIgnored
);
nxagentNumDefaultColormapsRecBackup
=
0
;
nxagentNumDefaultColormapsRecBackup
=
0
;
free
(
nxagentVisualsRecBackup
);
nxagentNumVisualsRecBackup
=
0
;
if
(
nxagentVisualHasBeenIgnored
)
{
free
(
nxagentVisualHasBeenIgnored
);
nxagentVisualHasBeenIgnored
=
NULL
;
}
nxagentDefaultDepthRecBackup
=
0
;
nxagentDefaultDepthRecBackup
=
0
;
nxagentDisplayWidthRecBackup
=
0
;
nxagentDisplayWidthRecBackup
=
0
;
nxagentDisplayHeightRecBackup
=
0
;
nxagentDisplayHeightRecBackup
=
0
;
...
@@ -2054,7 +2033,6 @@ void nxagentCleanupBackupDisplayInfo(void)
...
@@ -2054,7 +2033,6 @@ void nxagentCleanupBackupDisplayInfo(void)
if
(
nxagentDisplayBackup
)
if
(
nxagentDisplayBackup
)
{
{
XCloseDisplay
(
nxagentDisplayBackup
);
XCloseDisplay
(
nxagentDisplayBackup
);
nxagentDisplayBackup
=
NULL
;
nxagentDisplayBackup
=
NULL
;
}
}
...
@@ -2066,7 +2044,7 @@ void nxagentCleanupBackupDisplayInfo(void)
...
@@ -2066,7 +2044,7 @@ void nxagentCleanupBackupDisplayInfo(void)
}
}
else
else
{
{
free
(
nxagentBitmapGCBackup
);
SAFE_
free
(
nxagentBitmapGCBackup
);
}
}
nxagentBitmapGCBackup
=
NULL
;
nxagentBitmapGCBackup
=
NULL
;
...
@@ -2569,7 +2547,7 @@ FIXME: Should the visual be ignored in this case?
...
@@ -2569,7 +2547,7 @@ FIXME: Should the visual be ignored in this case?
}
}
}
}
XFree
(
viList
);
SAFE_
XFree
(
viList
);
if
(
compatible
)
if
(
compatible
)
{
{
...
@@ -2585,7 +2563,7 @@ FIXME: Should the visual be ignored in this case?
...
@@ -2585,7 +2563,7 @@ FIXME: Should the visual be ignored in this case?
fprintf
(
stderr
,
"nxagentInitAndCheckVisuals: New visuals don't match with old visuals.
\n
"
);
fprintf
(
stderr
,
"nxagentInitAndCheckVisuals: New visuals don't match with old visuals.
\n
"
);
#endif
#endif
free
(
newVisuals
);
SAFE_
free
(
newVisuals
);
}
}
return
compatible
;
return
compatible
;
...
@@ -2766,19 +2744,8 @@ Bool nxagentReconnectDisplay(void *p0)
...
@@ -2766,19 +2744,8 @@ Bool nxagentReconnectDisplay(void *p0)
* will be reallocated in nxagentInitPixmapFormats().
* will be reallocated in nxagentInitPixmapFormats().
*/
*/
if
(
nxagentPixmapFormats
!=
NULL
)
SAFE_XFree
(
nxagentPixmapFormats
);
{
SAFE_XFree
(
nxagentRemotePixmapFormats
);
XFree
(
nxagentPixmapFormats
);
nxagentPixmapFormats
=
NULL
;
}
if
(
nxagentRemotePixmapFormats
!=
NULL
)
{
XFree
(
nxagentRemotePixmapFormats
);
nxagentRemotePixmapFormats
=
NULL
;
}
/*
/*
* Check if all the required pixmap
* Check if all the required pixmap
...
...
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