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
6f80a06f
You need to sign in or sign up before continuing.
Unverified
Commit
6f80a06f
authored
Aug 27, 2019
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/safe_free' into 3.6.x
Attributes GH PR #826:
https://github.com/ArcticaProject/nx-libs/pull/826
parents
8b15d574
f39b81d3
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
217 additions
and
316 deletions
+217
-316
Args.c
nx-X11/programs/Xserver/hw/nxagent/Args.c
+6
-8
Atoms.c
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+6
-10
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+1
-2
Colormap.c
nx-X11/programs/Xserver/hw/nxagent/Colormap.c
+11
-10
Cursor.c
nx-X11/programs/Xserver/hw/nxagent/Cursor.c
+3
-4
Display.c
nx-X11/programs/Xserver/hw/nxagent/Display.c
+16
-49
Drawable.c
nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+6
-5
Error.c
nx-X11/programs/Xserver/hw/nxagent/Error.c
+7
-6
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+7
-28
Font.c
nx-X11/programs/Xserver/hw/nxagent/Font.c
+26
-37
GC.c
nx-X11/programs/Xserver/hw/nxagent/GC.c
+9
-9
GCOps.c
nx-X11/programs/Xserver/hw/nxagent/GCOps.c
+4
-3
Image.c
nx-X11/programs/Xserver/hw/nxagent/Image.c
+12
-15
Keyboard.c
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+34
-36
Keystroke.c
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+2
-2
Pixmap.c
nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+7
-6
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+5
-7
Render.c
nx-X11/programs/Xserver/hw/nxagent/Render.c
+3
-2
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+6
-9
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+29
-44
Utils.h
nx-X11/programs/Xserver/hw/nxagent/Utils.h
+1
-0
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+16
-24
No files found.
nx-X11/programs/Xserver/hw/nxagent/Args.c
View file @
6f80a06f
...
@@ -195,7 +195,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
...
@@ -195,7 +195,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
{
char
*
basec
=
strdup
(
argv
[
0
]);
char
*
basec
=
strdup
(
argv
[
0
]);
nxagentProgName
=
strdup
(
basename
(
basec
));
nxagentProgName
=
strdup
(
basename
(
basec
));
free
(
basec
);
SAFE_
free
(
basec
);
/*
/*
* Check if we are running as X2Go Agent
* Check if we are running as X2Go Agent
...
@@ -270,7 +270,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
...
@@ -270,7 +270,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
{
nxagentParseOptionString
(
envOptions
);
nxagentParseOptionString
(
envOptions
);
free
(
envOptions
);
SAFE_
free
(
envOptions
);
}
}
for
(
j
=
0
;
j
<
argc
;
j
++
)
for
(
j
=
0
;
j
<
argc
;
j
++
)
...
@@ -378,8 +378,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
...
@@ -378,8 +378,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
{
if
(
++
i
<
argc
)
if
(
++
i
<
argc
)
{
{
free
(
nxagentOptionsFilenameOrString
);
SAFE_free
(
nxagentOptionsFilenameOrString
);
nxagentOptionsFilenameOrString
=
NULL
;
if
(
-
1
==
asprintf
(
&
nxagentOptionsFilenameOrString
,
"%s"
,
argv
[
i
]))
if
(
-
1
==
asprintf
(
&
nxagentOptionsFilenameOrString
,
"%s"
,
argv
[
i
]))
{
{
...
@@ -716,8 +715,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
...
@@ -716,8 +715,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
{
if
(
++
i
<
argc
)
if
(
++
i
<
argc
)
{
{
free
(
nxagentKeyboard
);
SAFE_free
(
nxagentKeyboard
);
nxagentKeyboard
=
NULL
;
nxagentKeyboard
=
strdup
(
argv
[
i
]);
nxagentKeyboard
=
strdup
(
argv
[
i
]);
if
(
nxagentKeyboard
==
NULL
)
if
(
nxagentKeyboard
==
NULL
)
...
@@ -1574,7 +1572,7 @@ static void nxagentParseSingleOption(char *name, char *value)
...
@@ -1574,7 +1572,7 @@ static void nxagentParseSingleOption(char *name, char *value)
ddxProcessArgument
(
argc
,
argv
,
0
);
ddxProcessArgument
(
argc
,
argv
,
0
);
free
(
argv
[
0
]);
SAFE_
free
(
argv
[
0
]);
}
}
static
void
nxagentParseOptionString
(
char
*
string
)
static
void
nxagentParseOptionString
(
char
*
string
)
...
@@ -1761,7 +1759,7 @@ void nxagentProcessOptionsFile(char * filename)
...
@@ -1761,7 +1759,7 @@ void nxagentProcessOptionsFile(char * filename)
nxagentProcessOptionsFileExit:
nxagentProcessOptionsFileExit:
free
(
data
);
SAFE_
free
(
data
);
if
(
file
)
if
(
file
)
{
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
View file @
6f80a06f
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include "Screen.h"
#include "Screen.h"
#include "Options.h"
#include "Options.h"
#include "Agent.h"
#include "Agent.h"
#include "Utils.h"
/*
/*
* Set here the required log level.
* Set here the required log level.
...
@@ -53,11 +54,6 @@
...
@@ -53,11 +54,6 @@
#undef TEST
#undef TEST
#undef DEBUG
#undef DEBUG
#ifdef DEBUG
/* for validateString() */
#include "Utils.h"
#endif
/*
/*
* These values should be moved in
* These values should be moved in
* the option repository.
* the option repository.
...
@@ -482,8 +478,8 @@ static int nxagentInitAtomMap(char **atomNameList, int count, Atom *atomsRet)
...
@@ -482,8 +478,8 @@ static int nxagentInitAtomMap(char **atomNameList, int count, Atom *atomsRet)
fprintf
(
stderr
,
"nxagentInitAtomMap: WARNING! XInternAtoms request failed.
\n
"
);
fprintf
(
stderr
,
"nxagentInitAtomMap: WARNING! XInternAtoms request failed.
\n
"
);
#endif
#endif
free
(
atom_list
);
SAFE_
free
(
atom_list
);
free
(
name_list
);
SAFE_
free
(
name_list
);
return
0
;
return
0
;
}
}
...
@@ -523,8 +519,8 @@ static int nxagentInitAtomMap(char **atomNameList, int count, Atom *atomsRet)
...
@@ -523,8 +519,8 @@ static int nxagentInitAtomMap(char **atomNameList, int count, Atom *atomsRet)
}
}
}
}
free
(
atom_list
);
SAFE_
free
(
atom_list
);
free
(
name_list
);
SAFE_
free
(
name_list
);
nxagentPrintAtomMapInfo
(
"nxagentInitAtomMap: Exiting"
);
nxagentPrintAtomMapInfo
(
"nxagentInitAtomMap: Exiting"
);
...
@@ -794,7 +790,7 @@ Atom nxagentRemoteToLocalAtom(Atom remote)
...
@@ -794,7 +790,7 @@ Atom nxagentRemoteToLocalAtom(Atom remote)
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"%s: remote [%d (%s)] -> local [%d]
\n
"
,
__func__
,
remote
,
string
,
local
);
fprintf
(
stderr
,
"%s: remote [%d (%s)] -> local [%d]
\n
"
,
__func__
,
remote
,
string
,
local
);
#endif
#endif
XFree
(
string
);
SAFE_
XFree
(
string
);
return
local
;
return
local
;
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
6f80a06f
...
@@ -1783,8 +1783,7 @@ int nxagentInitClipboard(WindowPtr pWin)
...
@@ -1783,8 +1783,7 @@ int nxagentInitClipboard(WindowPtr pWin)
fprintf
(
stderr
,
"%s: Got called.
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: Got called.
\n
"
,
__func__
);
#endif
#endif
free
(
lastSelectionOwner
);
SAFE_free
(
lastSelectionOwner
);
lastSelectionOwner
=
NULL
;
lastSelectionOwner
=
(
SelectionOwner
*
)
malloc
(
nxagentMaxSelections
*
sizeof
(
SelectionOwner
));
lastSelectionOwner
=
(
SelectionOwner
*
)
malloc
(
nxagentMaxSelections
*
sizeof
(
SelectionOwner
));
...
...
nx-X11/programs/Xserver/hw/nxagent/Colormap.c
View file @
6f80a06f
...
@@ -54,6 +54,7 @@ is" without express or implied warranty.
...
@@ -54,6 +54,7 @@ is" without express or implied warranty.
#include "Visual.h"
#include "Visual.h"
#include "Windows.h"
#include "Windows.h"
#include "Args.h"
#include "Args.h"
#include "Utils.h"
#define PANIC
#define PANIC
#define WARNING
#define WARNING
...
@@ -120,7 +121,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
...
@@ -120,7 +121,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap
->
red
[
i
].
co
.
local
.
green
=
colors
[
i
].
red
;
pCmap
->
red
[
i
].
co
.
local
.
green
=
colors
[
i
].
red
;
pCmap
->
red
[
i
].
co
.
local
.
blue
=
colors
[
i
].
red
;
pCmap
->
red
[
i
].
co
.
local
.
blue
=
colors
[
i
].
red
;
}
}
free
(
colors
);
SAFE_
free
(
colors
);
break
;
break
;
case
StaticColor
:
/* read only */
case
StaticColor
:
/* read only */
...
@@ -133,7 +134,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
...
@@ -133,7 +134,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap
->
red
[
i
].
co
.
local
.
green
=
colors
[
i
].
green
;
pCmap
->
red
[
i
].
co
.
local
.
green
=
colors
[
i
].
green
;
pCmap
->
red
[
i
].
co
.
local
.
blue
=
colors
[
i
].
blue
;
pCmap
->
red
[
i
].
co
.
local
.
blue
=
colors
[
i
].
blue
;
}
}
free
(
colors
);
SAFE_
free
(
colors
);
break
;
break
;
case
TrueColor
:
/* read only */
case
TrueColor
:
/* read only */
...
@@ -157,7 +158,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
...
@@ -157,7 +158,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap
->
green
[
i
].
co
.
local
.
green
=
colors
[
i
].
green
;
pCmap
->
green
[
i
].
co
.
local
.
green
=
colors
[
i
].
green
;
pCmap
->
blue
[
i
].
co
.
local
.
blue
=
colors
[
i
].
blue
;
pCmap
->
blue
[
i
].
co
.
local
.
blue
=
colors
[
i
].
blue
;
}
}
free
(
colors
);
SAFE_
free
(
colors
);
break
;
break
;
case
GrayScale
:
/* read and write */
case
GrayScale
:
/* read and write */
...
@@ -176,7 +177,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
...
@@ -176,7 +177,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
void
nxagentDestroyColormap
(
ColormapPtr
pCmap
)
void
nxagentDestroyColormap
(
ColormapPtr
pCmap
)
{
{
XFreeColormap
(
nxagentDisplay
,
nxagentColormap
(
pCmap
));
XFreeColormap
(
nxagentDisplay
,
nxagentColormap
(
pCmap
));
free
(
pCmap
->
devPriv
);
SAFE_
free
(
pCmap
->
devPriv
);
}
}
#define SEARCH_PREDICATE \
#define SEARCH_PREDICATE \
...
@@ -254,10 +255,10 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
...
@@ -254,10 +255,10 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
numWindows
=
0
;
numWindows
=
0
;
}
}
free
(
icws
.
cmapIDs
);
SAFE_
free
(
icws
.
cmapIDs
);
if
(
!
nxagentSameInstalledColormapWindows
(
icws
.
windows
,
icws
.
numWindows
))
{
if
(
!
nxagentSameInstalledColormapWindows
(
icws
.
windows
,
icws
.
numWindows
))
{
free
(
nxagentOldInstalledColormapWindows
);
SAFE_
free
(
nxagentOldInstalledColormapWindows
);
#ifdef _XSERVER64
#ifdef _XSERVER64
{
{
...
@@ -268,7 +269,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
...
@@ -268,7 +269,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
windows
[
i
]
=
icws
.
windows
[
i
];
windows
[
i
]
=
icws
.
windows
[
i
];
XSetWMColormapWindows
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
XSetWMColormapWindows
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
windows
,
numWindows
);
windows
,
numWindows
);
free
(
windows
);
SAFE_
free
(
windows
);
}
}
#else
#else
XSetWMColormapWindows
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
XSetWMColormapWindows
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
...
@@ -317,12 +318,12 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
...
@@ -317,12 +318,12 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
#endif
/* DUMB_WINDOW_MANAGERS */
#endif
/* DUMB_WINDOW_MANAGERS */
}
}
else
else
free
(
icws
.
windows
);
SAFE_
free
(
icws
.
windows
);
}
}
void
nxagentSetScreenSaverColormapWindow
(
ScreenPtr
pScreen
)
void
nxagentSetScreenSaverColormapWindow
(
ScreenPtr
pScreen
)
{
{
free
(
nxagentOldInstalledColormapWindows
);
SAFE_
free
(
nxagentOldInstalledColormapWindows
);
#ifdef _XSERVER64
#ifdef _XSERVER64
{
{
...
@@ -454,7 +455,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
...
@@ -454,7 +455,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
pColors64
[
i
].
flags
=
pColors
[
i
].
flags
;
pColors64
[
i
].
flags
=
pColors
[
i
].
flags
;
}
}
XStoreColors
(
nxagentDisplay
,
nxagentColormap
(
pCmap
),
pColors64
,
nColors
);
XStoreColors
(
nxagentDisplay
,
nxagentColormap
(
pCmap
),
pColors64
,
nColors
);
free
(
pColors64
);
SAFE_
free
(
pColors64
);
}
}
#else
#else
XStoreColors
(
nxagentDisplay
,
nxagentColormap
(
pCmap
),
XStoreColors
(
nxagentDisplay
,
nxagentColormap
(
pCmap
),
...
...
nx-X11/programs/Xserver/hw/nxagent/Cursor.c
View file @
6f80a06f
...
@@ -61,6 +61,7 @@ is" without express or implied warranty.
...
@@ -61,6 +61,7 @@ is" without express or implied warranty.
#include "Events.h"
#include "Events.h"
#include "Render.h"
#include "Render.h"
#include "Client.h"
#include "Client.h"
#include "Utils.h"
#include "windowstr.h"
#include "windowstr.h"
#include "resource.h"
#include "resource.h"
...
@@ -211,7 +212,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
...
@@ -211,7 +212,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
XPutImage
(
nxagentDisplay
,
source
,
nxagentBitmapGC
,
image
,
XPutImage
(
nxagentDisplay
,
source
,
nxagentBitmapGC
,
image
,
0
,
0
,
0
,
0
,
pCursor
->
bits
->
width
,
pCursor
->
bits
->
height
);
0
,
0
,
0
,
0
,
pCursor
->
bits
->
width
,
pCursor
->
bits
->
height
);
XFree
(
image
);
SAFE_
XFree
(
image
);
image
=
XCreateImage
(
nxagentDisplay
,
image
=
XCreateImage
(
nxagentDisplay
,
nxagentDefaultVisual
(
pScreen
),
nxagentDefaultVisual
(
pScreen
),
...
@@ -229,7 +230,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
...
@@ -229,7 +230,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
XPutImage
(
nxagentDisplay
,
mask
,
nxagentBitmapGC
,
image
,
XPutImage
(
nxagentDisplay
,
mask
,
nxagentBitmapGC
,
image
,
0
,
0
,
0
,
0
,
pCursor
->
bits
->
width
,
pCursor
->
bits
->
height
);
0
,
0
,
0
,
0
,
pCursor
->
bits
->
width
,
pCursor
->
bits
->
height
);
XFree
(
image
);
SAFE_
XFree
(
image
);
fg_color
.
red
=
pCursor
->
foreRed
;
fg_color
.
red
=
pCursor
->
foreRed
;
fg_color
.
green
=
pCursor
->
foreGreen
;
fg_color
.
green
=
pCursor
->
foreGreen
;
...
@@ -264,14 +265,12 @@ Bool nxagentUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
...
@@ -264,14 +265,12 @@ Bool nxagentUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
if
(
nxagentCursorUsesRender
(
pCursor
,
pScreen
))
if
(
nxagentCursorUsesRender
(
pCursor
,
pScreen
))
{
{
PicturePtr
pPicture
=
nxagentCursorPicture
(
pCursor
,
pScreen
);
PicturePtr
pPicture
=
nxagentCursorPicture
(
pCursor
,
pScreen
);
FreePicture
(
pPicture
,
pPicture
->
id
);
FreePicture
(
pPicture
,
pPicture
->
id
);
}
}
if
(
nxagentCursor
(
pCursor
,
pScreen
)
!=
None
)
if
(
nxagentCursor
(
pCursor
,
pScreen
)
!=
None
)
{
{
XFreeCursor
(
nxagentDisplay
,
nxagentCursor
(
pCursor
,
pScreen
));
XFreeCursor
(
nxagentDisplay
,
nxagentCursor
(
pCursor
,
pScreen
));
nxagentCursor
(
pCursor
,
pScreen
)
=
None
;
nxagentCursor
(
pCursor
,
pScreen
)
=
None
;
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Display.c
View file @
6f80a06f
...
@@ -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"
...
@@ -1534,7 +1535,7 @@ void nxagentInitVisuals(void)
...
@@ -1534,7 +1535,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
)
{
{
...
@@ -1756,20 +1757,11 @@ void nxagentCloseDisplay(void)
...
@@ -1756,20 +1757,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
();
/*
/*
...
@@ -2008,11 +2000,7 @@ void nxagentBackupDisplayInfo(void)
...
@@ -2008,11 +2000,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
));
...
@@ -2024,20 +2012,11 @@ void nxagentBackupDisplayInfo(void)
...
@@ -2024,20 +2012,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
;
...
@@ -2045,7 +2024,6 @@ void nxagentCleanupBackupDisplayInfo(void)
...
@@ -2045,7 +2024,6 @@ void nxagentCleanupBackupDisplayInfo(void)
if
(
nxagentDisplayBackup
)
if
(
nxagentDisplayBackup
)
{
{
XCloseDisplay
(
nxagentDisplayBackup
);
XCloseDisplay
(
nxagentDisplayBackup
);
nxagentDisplayBackup
=
NULL
;
nxagentDisplayBackup
=
NULL
;
}
}
...
@@ -2057,7 +2035,7 @@ void nxagentCleanupBackupDisplayInfo(void)
...
@@ -2057,7 +2035,7 @@ void nxagentCleanupBackupDisplayInfo(void)
}
}
else
else
{
{
free
(
nxagentBitmapGCBackup
);
SAFE_
free
(
nxagentBitmapGCBackup
);
}
}
nxagentBitmapGCBackup
=
NULL
;
nxagentBitmapGCBackup
=
NULL
;
...
@@ -2560,7 +2538,7 @@ FIXME: Should the visual be ignored in this case?
...
@@ -2560,7 +2538,7 @@ FIXME: Should the visual be ignored in this case?
}
}
}
}
XFree
(
viList
);
SAFE_
XFree
(
viList
);
if
(
compatible
)
if
(
compatible
)
{
{
...
@@ -2576,7 +2554,7 @@ FIXME: Should the visual be ignored in this case?
...
@@ -2576,7 +2554,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
;
...
@@ -2757,19 +2735,8 @@ Bool nxagentReconnectDisplay(void *p0)
...
@@ -2757,19 +2735,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
...
...
nx-X11/programs/Xserver/hw/nxagent/Drawable.c
View file @
6f80a06f
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include "Pixels.h"
#include "Pixels.h"
#include "Reconnect.h"
#include "Reconnect.h"
#include "GCOps.h"
#include "GCOps.h"
#include "Utils.h"
#include "compext/Compext.h"
#include "compext/Compext.h"
...
@@ -365,7 +366,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
...
@@ -365,7 +366,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
success
=
nxagentSynchronizeRegion
(
pDrawable
,
NullRegion
,
breakMask
,
owner
);
success
=
nxagentSynchronizeRegion
(
pDrawable
,
NullRegion
,
breakMask
,
owner
);
nxagentSynchronizeDrawableDataEnd:
nxagentSynchronizeDrawableDataEnd:
free
(
data
);
SAFE_
free
(
data
);
return
success
;
return
success
;
}
}
...
@@ -861,7 +862,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
...
@@ -861,7 +862,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
#endif
#endif
}
}
free
(
cmpData
);
SAFE_
free
(
cmpData
);
}
}
}
}
else
else
...
@@ -1058,7 +1059,7 @@ nxagentSynchronizeRegionFree:
...
@@ -1058,7 +1059,7 @@ nxagentSynchronizeRegionFree:
nxagentFreeRegion
(
pDrawable
,
clipRegion
);
nxagentFreeRegion
(
pDrawable
,
clipRegion
);
}
}
free
(
data
);
SAFE_
free
(
data
);
RegionUninit
(
&
exposeRegion
);
RegionUninit
(
&
exposeRegion
);
...
@@ -2158,7 +2159,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel)
...
@@ -2158,7 +2159,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel)
fprintf
(
stderr
,
"nxagentGetColor: WARNING! Failed to create the XImage.
\n
"
);
fprintf
(
stderr
,
"nxagentGetColor: WARNING! Failed to create the XImage.
\n
"
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
return
-
1
;
return
-
1
;
}
}
...
@@ -2384,7 +2385,7 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion)
...
@@ -2384,7 +2385,7 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion)
XFillRectangles
(
nxagentDisplay
,
nxagentDrawable
(
pDrawable
),
nxagentGC
(
pGC
),
XFillRectangles
(
nxagentDisplay
,
nxagentDrawable
(
pDrawable
),
nxagentGC
(
pGC
),
pRects
,
nrects
);
pRects
,
nrects
);
free
(
pRects
);
SAFE_
free
(
pRects
);
}
}
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Error.c
View file @
6f80a06f
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include "Error.h"
#include "Error.h"
#include "Args.h"
#include "Args.h"
#include "Utils.h"
/*
/*
* Set here the required log level.
* Set here the required log level.
...
@@ -425,7 +426,7 @@ char *nxagentGetRootPath(void)
...
@@ -425,7 +426,7 @@ char *nxagentGetRootPath(void)
"home directory '%s'.
\n
"
,
homeEnv
);
"home directory '%s'.
\n
"
,
homeEnv
);
#endif
#endif
free
(
homeEnv
);
SAFE_
free
(
homeEnv
);
return
NULL
;
return
NULL
;
}
}
...
@@ -436,7 +437,7 @@ char *nxagentGetRootPath(void)
...
@@ -436,7 +437,7 @@ char *nxagentGetRootPath(void)
snprintf
(
nxagentRootDir
,
DEFAULT_STRING_LENGTH
,
"%s/.nx"
,
homeEnv
);
snprintf
(
nxagentRootDir
,
DEFAULT_STRING_LENGTH
,
"%s/.nx"
,
homeEnv
);
free
(
homeEnv
);
SAFE_
free
(
homeEnv
);
/*
/*
* Create the NX root directory.
* Create the NX root directory.
...
@@ -534,14 +535,14 @@ char *nxagentGetSessionPath(void)
...
@@ -534,14 +535,14 @@ char *nxagentGetSessionPath(void)
nxagentSessionDir
);
nxagentSessionDir
);
#endif
#endif
free
(
rootPath
);
SAFE_
free
(
rootPath
);
return
NULL
;
return
NULL
;
}
}
snprintf
(
nxagentSessionDir
,
DEFAULT_STRING_LENGTH
,
"%s/C-%s"
,
rootPath
,
nxagentSessionId
);
snprintf
(
nxagentSessionDir
,
DEFAULT_STRING_LENGTH
,
"%s/C-%s"
,
rootPath
,
nxagentSessionId
);
free
(
rootPath
);
SAFE_
free
(
rootPath
);
if
((
stat
(
nxagentSessionDir
,
&
dirStat
)
==
-
1
)
&&
(
errno
==
ENOENT
))
if
((
stat
(
nxagentSessionDir
,
&
dirStat
)
==
-
1
)
&&
(
errno
==
ENOENT
))
{
{
...
@@ -595,14 +596,14 @@ void nxagentGetClientsPath(void)
...
@@ -595,14 +596,14 @@ void nxagentGetClientsPath(void)
fprintf
(
stderr
,
"nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path ''.
\n
"
);
fprintf
(
stderr
,
"nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path ''.
\n
"
);
#endif
#endif
free
(
sessionPath
);
SAFE_
free
(
sessionPath
);
return
;
return
;
}
}
snprintf
(
nxagentClientsLogName
,
NXAGENTCLIENTSLOGNAMELENGTH
,
"%s/clients"
,
sessionPath
);
snprintf
(
nxagentClientsLogName
,
NXAGENTCLIENTSLOGNAMELENGTH
,
"%s/clients"
,
sessionPath
);
free
(
sessionPath
);
SAFE_
free
(
sessionPath
);
}
}
return
;
return
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
6f80a06f
...
@@ -328,7 +328,7 @@ void nxagentRemoteWindowID(Window window, Bool newline)
...
@@ -328,7 +328,7 @@ void nxagentRemoteWindowID(Window window, Bool newline)
else
if
(
winName
)
else
if
(
winName
)
{
{
fprintf
(
stderr
,
"
\"
%s
\"
"
,
winName
);
fprintf
(
stderr
,
"
\"
%s
\"
"
,
winName
);
XFree
(
winName
);
SAFE_
XFree
(
winName
);
}
}
#else
#else
...
@@ -476,10 +476,7 @@ void nxagentRemoteWindowsTree(Window window, int level)
...
@@ -476,10 +476,7 @@ void nxagentRemoteWindowsTree(Window window, int level)
nxagentRemoteWindowsTree
(
childList
[
i
],
level
+
1
);
nxagentRemoteWindowsTree
(
childList
[
i
],
level
+
1
);
}
}
if
(
childList
)
SAFE_XFree
((
char
*
)
childList
);
{
XFree
((
char
*
)
childList
);
}
}
}
#endif
#endif
...
@@ -3133,10 +3130,7 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X)
...
@@ -3133,10 +3130,7 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X)
#endif
#endif
}
}
if
(
children_return
)
SAFE_XFree
(
children_return
);
{
XFree
(
children_return
);
}
#if 0
#if 0
fprintf(stderr, "nxagentCheckWindowConfiguration: Trees match: %s\n",
fprintf(stderr, "nxagentCheckWindowConfiguration: Trees match: %s\n",
...
@@ -3514,11 +3508,7 @@ int nxagentHandleReparentNotify(XEvent* X)
...
@@ -3514,11 +3508,7 @@ int nxagentHandleReparentNotify(XEvent* X)
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
root_return
,
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
root_return
,
&
parent_return
,
&
children_return
,
&
nchildren_return
);
&
parent_return
,
&
children_return
,
&
nchildren_return
);
if
(
children_return
)
SAFE_XFree
(
children_return
);
{
XFree
(
children_return
);
children_return
=
NULL
;
}
if
(
!
result
)
if
(
!
result
)
{
{
...
@@ -3556,11 +3546,7 @@ int nxagentHandleReparentNotify(XEvent* X)
...
@@ -3556,11 +3546,7 @@ int nxagentHandleReparentNotify(XEvent* X)
#endif
#endif
}
}
if
(
children_return
)
SAFE_XFree
(
children_return
);
{
XFree
(
children_return
);
children_return
=
NULL
;
}
}
}
else
else
{
{
...
@@ -3624,11 +3610,7 @@ int nxagentHandleReparentNotify(XEvent* X)
...
@@ -3624,11 +3610,7 @@ int nxagentHandleReparentNotify(XEvent* X)
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
rootReturn
,
&
parentReturn
,
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
rootReturn
,
&
parentReturn
,
&
childrenReturn
,
&
nchildrenReturn
);
&
childrenReturn
,
&
nchildrenReturn
);
if
(
childrenReturn
)
SAFE_XFree
(
childrenReturn
);
{
XFree
(
childrenReturn
);
childrenReturn
=
NULL
;
}
if
(
parentReturn
==
rootReturn
||
parentReturn
==
0
||
result
==
0
)
if
(
parentReturn
==
rootReturn
||
parentReturn
==
0
||
result
==
0
)
{
{
...
@@ -4025,10 +4007,7 @@ void nxagentHandleCollectPropertyEvent(XEvent *X)
...
@@ -4025,10 +4007,7 @@ void nxagentHandleCollectPropertyEvent(XEvent *X)
#endif
#endif
}
}
if
(
pszReturnData
!=
NULL
)
SAFE_XFree
(
pszReturnData
);
{
XFree
(
pszReturnData
);
}
return
;
return
;
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Font.c
View file @
6f80a06f
...
@@ -188,11 +188,11 @@ void nxagentFreeFontCache(void)
...
@@ -188,11 +188,11 @@ void nxagentFreeFontCache(void)
nxagentFreeFont
(
CACHE_FSTRUCT
(
i
));
nxagentFreeFont
(
CACHE_FSTRUCT
(
i
));
}
}
free
(
CACHE_NAME
(
i
));
SAFE_
free
(
CACHE_NAME
(
i
));
free
(
CACHE_ENTRY
(
i
));
SAFE_
free
(
CACHE_ENTRY
(
i
));
}
}
free
(
CACHE_ENTRY_PTR
);
SAFE_
free
(
CACHE_ENTRY_PTR
);
CACHE_ENTRY_PTR
=
NULL
;
CACHE_ENTRY_PTR
=
NULL
;
CACHE_INDEX
=
0
;
CACHE_INDEX
=
0
;
CACHE_SIZE
=
0
;
CACHE_SIZE
=
0
;
...
@@ -324,8 +324,7 @@ void nxagentListRemoteAddName(const char *name, int status)
...
@@ -324,8 +324,7 @@ void nxagentListRemoteAddName(const char *name, int status)
if
(
nxagentRemoteFontList
.
list
[
pos
]
->
name
==
NULL
)
if
(
nxagentRemoteFontList
.
list
[
pos
]
->
name
==
NULL
)
{
{
fprintf
(
stderr
,
"Font: remote list name memory allocation failed!.
\n
"
);
fprintf
(
stderr
,
"Font: remote list name memory allocation failed!.
\n
"
);
free
(
nxagentRemoteFontList
.
list
[
pos
]);
SAFE_free
(
nxagentRemoteFontList
.
list
[
pos
]);
nxagentRemoteFontList
.
list
[
pos
]
=
NULL
;
return
;
return
;
}
}
}
}
...
@@ -351,18 +350,14 @@ static void nxagentFreeRemoteFontList(nxagentFontList *listRec)
...
@@ -351,18 +350,14 @@ static void nxagentFreeRemoteFontList(nxagentFontList *listRec)
{
{
if
(
listRec
->
list
[
l
])
if
(
listRec
->
list
[
l
])
{
{
free
(
listRec
->
list
[
l
]
->
name
);
SAFE_free
(
listRec
->
list
[
l
]
->
name
);
listRec
->
list
[
l
]
->
name
=
NULL
;
SAFE_free
(
listRec
->
list
[
l
]);
free
(
listRec
->
list
[
l
]);
listRec
->
list
[
l
]
=
NULL
;
}
}
}
}
listRec
->
length
=
listRec
->
listSize
=
0
;
listRec
->
length
=
listRec
->
listSize
=
0
;
free
(
listRec
->
list
);
SAFE_free
(
listRec
->
list
);
listRec
->
list
=
NULL
;
return
;
return
;
}
}
...
@@ -434,7 +429,7 @@ Bool nxagentFontLookUp(const char *name)
...
@@ -434,7 +429,7 @@ Bool nxagentFontLookUp(const char *name)
{
{
result
=
nxagentFontFind
(
scalable
,
&
i
);
result
=
nxagentFontFind
(
scalable
,
&
i
);
free
(
scalable
);
SAFE_
free
(
scalable
);
}
}
}
}
...
@@ -448,7 +443,7 @@ Bool nxagentFontLookUp(const char *name)
...
@@ -448,7 +443,7 @@ Bool nxagentFontLookUp(const char *name)
{
{
result
=
nxagentFontFind
(
scalable
,
&
i
);
result
=
nxagentFontFind
(
scalable
,
&
i
);
free
(
scalable
);
SAFE_
free
(
scalable
);
}
}
}
}
...
@@ -813,7 +808,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
...
@@ -813,7 +808,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
for
(
j
=
0
;
j
<
numSearchFields
;
j
++
)
for
(
j
=
0
;
j
<
numSearchFields
;
j
++
)
{
{
free
(
searchFields
[
j
]);
SAFE_
free
(
searchFields
[
j
]);
}
}
}
}
}
}
...
@@ -830,7 +825,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
...
@@ -830,7 +825,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
for
(
j
=
0
;
j
<
numFontFields
;
j
++
)
for
(
j
=
0
;
j
<
numFontFields
;
j
++
)
{
{
free
(
fontNameFields
[
j
]);
SAFE_
free
(
fontNameFields
[
j
]);
}
}
return
fontStruct
;
return
fontStruct
;
...
@@ -890,10 +885,8 @@ static void nxagentCollectFailedFont(FontPtr fpt, XID id)
...
@@ -890,10 +885,8 @@ static void nxagentCollectFailedFont(FontPtr fpt, XID id)
if
(
nxagentFailedToReconnectFonts
.
font
==
NULL
||
nxagentFailedToReconnectFonts
.
id
==
NULL
)
if
(
nxagentFailedToReconnectFonts
.
font
==
NULL
||
nxagentFailedToReconnectFonts
.
id
==
NULL
)
{
{
free
(
nxagentFailedToReconnectFonts
.
font
);
SAFE_free
(
nxagentFailedToReconnectFonts
.
font
);
nxagentFailedToReconnectFonts
.
font
=
NULL
;
SAFE_free
(
nxagentFailedToReconnectFonts
.
id
);
free
(
nxagentFailedToReconnectFonts
.
id
);
nxagentFailedToReconnectFonts
.
id
=
NULL
;
FatalError
(
"Font: font not reconnected memory allocation failed!.
\n
"
);
FatalError
(
"Font: font not reconnected memory allocation failed!.
\n
"
);
}
}
...
@@ -1050,7 +1043,7 @@ static void nxagentCleanCacheAfterReconnect(void)
...
@@ -1050,7 +1043,7 @@ static void nxagentCleanCacheAfterReconnect(void)
{
{
if
(
CACHE_FSTRUCT
(
i
)
==
NULL
)
if
(
CACHE_FSTRUCT
(
i
)
==
NULL
)
{
{
XFree
(
CACHE_NAME
(
i
));
SAFE_
XFree
(
CACHE_NAME
(
i
));
real_size
--
;
real_size
--
;
}
}
}
}
...
@@ -1223,11 +1216,8 @@ static void nxagentFailedFontReconnect(FontPtr pFont, XID param1, void * param2)
...
@@ -1223,11 +1216,8 @@ static void nxagentFailedFontReconnect(FontPtr pFont, XID param1, void * param2)
static
void
nxagentFreeFailedToReconnectFonts
(
void
)
static
void
nxagentFreeFailedToReconnectFonts
(
void
)
{
{
free
(
nxagentFailedToReconnectFonts
.
font
);
SAFE_free
(
nxagentFailedToReconnectFonts
.
font
);
nxagentFailedToReconnectFonts
.
font
=
NULL
;
SAFE_free
(
nxagentFailedToReconnectFonts
.
id
);
free
(
nxagentFailedToReconnectFonts
.
id
);
nxagentFailedToReconnectFonts
.
id
=
NULL
;
nxagentFailedToReconnectFonts
.
size
=
0
;
nxagentFailedToReconnectFonts
.
size
=
0
;
nxagentFailedToReconnectFonts
.
index
=
0
;
nxagentFailedToReconnectFonts
.
index
=
0
;
...
@@ -1321,7 +1311,7 @@ Bool nxagentReconnectFailedFonts(void *p0)
...
@@ -1321,7 +1311,7 @@ Bool nxagentReconnectFailedFonts(void *p0)
nxagentListRemoteFonts
(
"*"
,
nxagentMaxFontNames
);
nxagentListRemoteFonts
(
"*"
,
nxagentMaxFontNames
);
XFreeFontPath
(
fontPaths
);
XFreeFontPath
(
fontPaths
);
free
(
newFontPaths
);
SAFE_
free
(
newFontPaths
);
return
False
;
return
False
;
}
}
...
@@ -1332,7 +1322,7 @@ Bool nxagentReconnectFailedFonts(void *p0)
...
@@ -1332,7 +1322,7 @@ Bool nxagentReconnectFailedFonts(void *p0)
XSetFontPath
(
nxagentDisplay
,
fontPaths
,
nPaths
);
XSetFontPath
(
nxagentDisplay
,
fontPaths
,
nPaths
);
XFreeFontPath
(
fontPaths
);
XFreeFontPath
(
fontPaths
);
free
(
newFontPaths
);
SAFE_
free
(
newFontPaths
);
nxagentCleanCacheAfterReconnect
();
nxagentCleanCacheAfterReconnect
();
...
@@ -1442,7 +1432,7 @@ void nxagentVerifySingleFontPath(char **dest, const char *fontDir)
...
@@ -1442,7 +1432,7 @@ void nxagentVerifySingleFontPath(char **dest, const char *fontDir)
if
(
rc
==
-
1
)
if
(
rc
==
-
1
)
return
;
return
;
free
(
*
dest
);
SAFE_
free
(
*
dest
);
*
dest
=
tmppath
;
*
dest
=
tmppath
;
tmppath
=
NULL
;
tmppath
=
NULL
;
}
}
...
@@ -1554,7 +1544,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
...
@@ -1554,7 +1544,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
fprintf
(
stderr
,
"nxagentLoadQueryFont: WARNING! Font not found '%s'.
\n
"
,
name
);
fprintf
(
stderr
,
"nxagentLoadQueryFont: WARNING! Font not found '%s'.
\n
"
,
name
);
#endif
#endif
free
(
fs
);
SAFE_
free
(
fs
);
return
(
XFontStruct
*
)
NULL
;
return
(
XFontStruct
*
)
NULL
;
}
}
...
@@ -1588,7 +1578,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
...
@@ -1588,7 +1578,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
fprintf
(
stderr
,
"nxagentLoadQueryFont: WARNING! Failed allocation of XFontProp."
);
fprintf
(
stderr
,
"nxagentLoadQueryFont: WARNING! Failed allocation of XFontProp."
);
#endif
#endif
free
((
char
*
)
fs
);
SAFE_free
(
fs
);
return
(
XFontStruct
*
)
NULL
;
return
(
XFontStruct
*
)
NULL
;
}
}
...
@@ -1622,18 +1612,17 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
...
@@ -1622,18 +1612,17 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
int
nxagentFreeFont
(
XFontStruct
*
fs
)
int
nxagentFreeFont
(
XFontStruct
*
fs
)
{
{
if
(
fs
->
per_char
)
if
(
fs
->
per_char
)
{
{
#ifdef USE_XF86BIGFONT
#ifdef USE_XF86BIGFONT
_XF86BigfontFreeFontMetrics
(
fs
);
_XF86BigfontFreeFontMetrics
(
fs
);
#else
#else
free
((
char
*
)
fs
->
per_char
);
SAFE_free
(
fs
->
per_char
);
#endif
#endif
}
}
free
(
fs
->
properties
);
SAFE_free
(
fs
->
properties
);
SAFE_XFree
(
fs
);
XFree
(
fs
);
return
1
;
return
1
;
}
}
...
@@ -1769,7 +1758,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
...
@@ -1769,7 +1758,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
MakeScalableFontNameError:
MakeScalableFontNameError:
free
(
scalableFontName
);
SAFE_
free
(
scalableFontName
);
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentMakeScalableFontName: Invalid font name.
\n
"
);
fprintf
(
stderr
,
"nxagentMakeScalableFontName: Invalid font name.
\n
"
);
...
...
nx-X11/programs/Xserver/hw/nxagent/GC.c
View file @
6f80a06f
...
@@ -61,6 +61,7 @@ is" without express or implied warranty.
...
@@ -61,6 +61,7 @@ is" without express or implied warranty.
#include "Trap.h"
#include "Trap.h"
#include "Screen.h"
#include "Screen.h"
#include "Pixels.h"
#include "Pixels.h"
#include "Utils.h"
#include "../../fb/fb.h"
#include "../../fb/fb.h"
...
@@ -694,7 +695,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
...
@@ -694,7 +695,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
XSetClipRectangles
(
nxagentDisplay
,
nxagentGC
(
pGC
),
pGC
->
clipOrg
.
x
,
pGC
->
clipOrg
.
y
,
XSetClipRectangles
(
nxagentDisplay
,
nxagentGC
(
pGC
),
pGC
->
clipOrg
.
x
,
pGC
->
clipOrg
.
y
,
pRects
,
nRects
,
Unsorted
);
pRects
,
nRects
,
Unsorted
);
free
((
char
*
)
pRects
);
SAFE_free
(
pRects
);
}
}
break
;
break
;
...
@@ -778,7 +779,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
...
@@ -778,7 +779,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
pGC
->
clientClip
=
(
void
*
)
RegionFromRects
(
nRects
,
pGC
->
clientClip
=
(
void
*
)
RegionFromRects
(
nRects
,
(
xRectangle
*
)
pValue
,
type
);
(
xRectangle
*
)
pValue
,
type
);
free
(
pValue
);
SAFE_
free
(
pValue
);
pValue
=
pGC
->
clientClip
;
pValue
=
pGC
->
clientClip
;
...
@@ -912,9 +913,8 @@ static void nxagentFreeGCRec(struct nxagentGCRec *t)
...
@@ -912,9 +913,8 @@ static void nxagentFreeGCRec(struct nxagentGCRec *t)
(
void
*
)
t
,
(
void
*
)
t
->
gc
);
(
void
*
)
t
,
(
void
*
)
t
->
gc
);
#endif
#endif
free
(
t
->
gc
);
SAFE_free
(
t
->
gc
);
SAFE_free
(
t
);
free
(
t
);
}
}
static
void
nxagentRestoreGCRec
(
struct
nxagentGCRec
*
t
)
static
void
nxagentRestoreGCRec
(
struct
nxagentGCRec
*
t
)
...
@@ -924,11 +924,11 @@ static void nxagentRestoreGCRec(struct nxagentGCRec *t)
...
@@ -924,11 +924,11 @@ static void nxagentRestoreGCRec(struct nxagentGCRec *t)
(
void
*
)
t
,
(
void
*
)
t
->
gc
);
(
void
*
)
t
,
(
void
*
)
t
->
gc
);
#endif
#endif
free
(
nxagentGC
(
t
->
pGC
));
SAFE_
free
(
nxagentGC
(
t
->
pGC
));
nxagentGC
(
t
->
pGC
)
=
t
->
gc
;
nxagentGC
(
t
->
pGC
)
=
t
->
gc
;
free
(
t
);
SAFE_
free
(
t
);
}
}
static
void
nxagentAddGCToList
(
GCPtr
pGC
)
static
void
nxagentAddGCToList
(
GCPtr
pGC
)
...
@@ -1303,7 +1303,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
...
@@ -1303,7 +1303,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
XSetClipRectangles
(
nxagentDisplay
,
nxagentGC
(
pGC
),
pGC
->
clipOrg
.
x
,
pGC
->
clipOrg
.
y
,
XSetClipRectangles
(
nxagentDisplay
,
nxagentGC
(
pGC
),
pGC
->
clipOrg
.
x
,
pGC
->
clipOrg
.
y
,
pRects
,
nRects
,
Unsorted
);
pRects
,
nRects
,
Unsorted
);
free
((
char
*
)
pRects
);
SAFE_free
(
pRects
);
}
}
else
else
{
{
...
@@ -1374,7 +1374,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
...
@@ -1374,7 +1374,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
pGC
->
clientClip
=
(
void
*
)
RegionFromRects
(
nRects
,
pGC
->
clientClip
=
(
void
*
)
RegionFromRects
(
nRects
,
(
xRectangle
*
)
pValue
,
type
);
(
xRectangle
*
)
pValue
,
type
);
free
(
pValue
);
SAFE_
free
(
pValue
);
pValue
=
pGC
->
clientClip
;
pValue
=
pGC
->
clientClip
;
type
=
CT_REGION
;
type
=
CT_REGION
;
...
...
nx-X11/programs/Xserver/hw/nxagent/GCOps.c
View file @
6f80a06f
...
@@ -57,6 +57,7 @@ is" without express or implied warranty.
...
@@ -57,6 +57,7 @@ is" without express or implied warranty.
#include "Holder.h"
#include "Holder.h"
#include "Args.h"
#include "Args.h"
#include "Screen.h"
#include "Screen.h"
#include "Utils.h"
#include "compext/Compext.h"
#include "compext/Compext.h"
...
@@ -787,7 +788,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
...
@@ -787,7 +788,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
srcx
,
srcy
,
width
,
height
);
srcx
,
srcy
,
width
,
height
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
/*
/*
* If the source is a shared memory pixmap, the
* If the source is a shared memory pixmap, the
...
@@ -1007,7 +1008,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
...
@@ -1007,7 +1008,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
srcx
,
srcy
,
width
,
height
);
srcx
,
srcy
,
width
,
height
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
/*
/*
* If the source is a shared memory pixmap, the
* If the source is a shared memory pixmap, the
...
@@ -1545,7 +1546,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
...
@@ -1545,7 +1546,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
RESET_GC_TRAP
();
RESET_GC_TRAP
();
}
}
free
(
newPoints
);
SAFE_
free
(
newPoints
);
}
}
void
nxagentPolyFillRect
(
DrawablePtr
pDrawable
,
GCPtr
pGC
,
void
nxagentPolyFillRect
(
DrawablePtr
pDrawable
,
GCPtr
pGC
,
...
...
nx-X11/programs/Xserver/hw/nxagent/Image.c
View file @
6f80a06f
...
@@ -455,7 +455,7 @@ FIXME: Here the split trap is always set and so the caching of
...
@@ -455,7 +455,7 @@ FIXME: Here the split trap is always set and so the caching of
if
(
nxagentUnpackAlpha
[
resource
]
!=
NULL
)
if
(
nxagentUnpackAlpha
[
resource
]
!=
NULL
)
{
{
free
(
nxagentUnpackAlpha
[
resource
]
->
data
);
SAFE_
free
(
nxagentUnpackAlpha
[
resource
]
->
data
);
}
}
else
if
((
nxagentUnpackAlpha
[
resource
]
=
malloc
(
sizeof
(
UnpackAlphaRec
)))
==
NULL
)
else
if
((
nxagentUnpackAlpha
[
resource
]
=
malloc
(
sizeof
(
UnpackAlphaRec
)))
==
NULL
)
{
{
...
@@ -463,7 +463,7 @@ FIXME: Here the split trap is always set and so the caching of
...
@@ -463,7 +463,7 @@ FIXME: Here the split trap is always set and so the caching of
fprintf
(
stderr
,
"nxagentSetUnpackAlpha: PANIC! Can't allocate data for the alpha structure.
\n
"
);
fprintf
(
stderr
,
"nxagentSetUnpackAlpha: PANIC! Can't allocate data for the alpha structure.
\n
"
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
return
;
return
;
}
}
...
@@ -483,7 +483,7 @@ FIXME: Here the split trap is always set and so the caching of
...
@@ -483,7 +483,7 @@ FIXME: Here the split trap is always set and so the caching of
resource
,
size
);
resource
,
size
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
}
}
}
}
...
@@ -1567,20 +1567,20 @@ nxagentPutSubImageEnd:
...
@@ -1567,20 +1567,20 @@ nxagentPutSubImageEnd:
nxagentImageStatistics
.
totalEncoded
,
nxagentImageStatistics
.
totalAdded
);
nxagentImageStatistics
.
totalEncoded
,
nxagentImageStatistics
.
totalAdded
);
#endif
#endif
free
(
packedChecksum
);
SAFE_
free
(
packedChecksum
);
if
(
packedImage
!=
NULL
)
if
(
packedImage
!=
NULL
)
{
{
if
(
packedImage
->
data
!=
NULL
&&
if
(
packedImage
->
data
!=
NULL
&&
packedImage
->
data
!=
plainImage
->
data
)
packedImage
->
data
!=
plainImage
->
data
)
{
{
free
(
packedImage
->
data
);
SAFE_
free
(
packedImage
->
data
);
}
}
free
(
packedImage
);
SAFE_
free
(
packedImage
);
}
}
free
(
plainImage
);
SAFE_
free
(
plainImage
);
}
}
void
nxagentGetImage
(
DrawablePtr
pDrawable
,
int
x
,
int
y
,
int
w
,
int
h
,
void
nxagentGetImage
(
DrawablePtr
pDrawable
,
int
x
,
int
y
,
int
w
,
int
h
,
...
@@ -1634,11 +1634,8 @@ void nxagentResetAlphaCache(void)
...
@@ -1634,11 +1634,8 @@ void nxagentResetAlphaCache(void)
{
{
if
(
nxagentUnpackAlpha
[
i
])
if
(
nxagentUnpackAlpha
[
i
])
{
{
free
(
nxagentUnpackAlpha
[
i
]
->
data
);
SAFE_free
(
nxagentUnpackAlpha
[
i
]
->
data
);
SAFE_free
(
nxagentUnpackAlpha
[
i
]);
free
(
nxagentUnpackAlpha
[
i
]);
nxagentUnpackAlpha
[
i
]
=
NULL
;
}
}
}
}
}
}
...
@@ -1716,7 +1713,7 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
...
@@ -1716,7 +1713,7 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
if
(
newImage
->
data
==
NULL
)
if
(
newImage
->
data
==
NULL
)
{
{
free
(
newImage
);
SAFE_
free
(
newImage
);
#ifdef PANIC
#ifdef PANIC
fprintf
(
stderr
,
"nxagentScaleImage: PANIC! Failed to create the target image data.
\n
"
);
fprintf
(
stderr
,
"nxagentScaleImage: PANIC! Failed to create the target image data.
\n
"
);
...
@@ -1784,8 +1781,8 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
...
@@ -1784,8 +1781,8 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
}
}
}
}
free
((
char
*
)
image
->
obdata
);
SAFE_free
(
image
->
obdata
);
free
((
char
*
)
image
);
SAFE_free
(
image
);
*
pImage
=
newImage
;
*
pImage
=
newImage
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
View file @
6f80a06f
...
@@ -58,6 +58,7 @@ is" without express or implied warranty.
...
@@ -58,6 +58,7 @@ is" without express or implied warranty.
#include "Options.h"
#include "Options.h"
#include "Error.h"
#include "Error.h"
#include "Init.h"
#include "Init.h"
#include "Utils.h"
#include "compext/Compext.h"
#include "compext/Compext.h"
...
@@ -657,7 +658,7 @@ N/A
...
@@ -657,7 +658,7 @@ N/A
{
{
keymap
[
i
]
=
keymap64
[
i
];
keymap
[
i
]
=
keymap64
[
i
];
}
}
XFree
(
keymap64
);
SAFE_
XFree
(
keymap64
);
}
}
#else
/* #ifdef _XSERVER64 */
#else
/* #ifdef _XSERVER64 */
...
@@ -762,7 +763,7 @@ XkbError:
...
@@ -762,7 +763,7 @@ XkbError:
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"%s: changing nxagentKeyboard from [null/null] to [clone].
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: changing nxagentKeyboard from [null/null] to [clone].
\n
"
,
__func__
);
#endif
#endif
free
(
nxagentKeyboard
);
SAFE_
free
(
nxagentKeyboard
);
nxagentKeyboard
=
strdup
(
"clone"
);
nxagentKeyboard
=
strdup
(
"clone"
);
}
}
...
@@ -809,7 +810,7 @@ XkbError:
...
@@ -809,7 +810,7 @@ XkbError:
layout
=
strdup
(
strsep
(
&
tmp
,
sep
));
layout
=
strdup
(
strsep
(
&
tmp
,
sep
));
variant
=
strdup
(
strsep
(
&
tmp
,
sep
));
variant
=
strdup
(
strsep
(
&
tmp
,
sep
));
options
=
strdup
(
strsep
(
&
tmp
,
sep
));
options
=
strdup
(
strsep
(
&
tmp
,
sep
));
free
(
rmlvo
);
SAFE_
free
(
rmlvo
);
}
}
else
else
{
{
...
@@ -864,11 +865,11 @@ XkbError:
...
@@ -864,11 +865,11 @@ XkbError:
/* Only setup keycode conversion if we are NOT in clone mode */
/* Only setup keycode conversion if we are NOT in clone mode */
if
(
nxagentKeyboard
&&
(
strcmp
(
nxagentKeyboard
,
"clone"
)
==
0
))
if
(
nxagentKeyboard
&&
(
strcmp
(
nxagentKeyboard
,
"clone"
)
==
0
))
{
{
free
(
rules
);
rules
=
strdup
(
nxagentRemoteRules
);
SAFE_
free
(
rules
);
rules
=
strdup
(
nxagentRemoteRules
);
free
(
model
);
model
=
strdup
(
nxagentRemoteModel
);
SAFE_
free
(
model
);
model
=
strdup
(
nxagentRemoteModel
);
free
(
layout
);
layout
=
strdup
(
nxagentRemoteLayout
);
SAFE_
free
(
layout
);
layout
=
strdup
(
nxagentRemoteLayout
);
free
(
variant
);
variant
=
strdup
(
nxagentRemoteVariant
);
SAFE_
free
(
variant
);
variant
=
strdup
(
nxagentRemoteVariant
);
free
(
options
);
options
=
strdup
(
nxagentRemoteOptions
);
SAFE_
free
(
options
);
options
=
strdup
(
nxagentRemoteOptions
);
/*
/*
* when cloning we do not want X2Go to set the keyboard
* when cloning we do not want X2Go to set the keyboard
* via a keyboard file generated by nxagent. The defined
* via a keyboard file generated by nxagent. The defined
...
@@ -947,9 +948,9 @@ XkbError:
...
@@ -947,9 +948,9 @@ XkbError:
NXShadowInitKeymap
(
&
(
pDev
->
key
->
curKeySyms
));
NXShadowInitKeymap
(
&
(
pDev
->
key
->
curKeySyms
));
}
}
free
(
rules
);
SAFE_
free
(
rules
);
free
(
variant
);
SAFE_
free
(
variant
);
free
(
options
);
SAFE_
free
(
options
);
}
}
if
(
xkb
)
if
(
xkb
)
...
@@ -958,8 +959,8 @@ XkbError:
...
@@ -958,8 +959,8 @@ XkbError:
xkb
=
NULL
;
xkb
=
NULL
;
}
}
free
(
model
);
SAFE_
free
(
model
);
free
(
layout
);
SAFE_
free
(
layout
);
#endif
#endif
#ifdef WATCH
#ifdef WATCH
...
@@ -980,9 +981,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -980,9 +981,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#endif
#endif
#ifdef _XSERVER64
#ifdef _XSERVER64
free
(
keymap
);
SAFE_
free
(
keymap
);
#else
#else
XFree
(
keymap
);
SAFE_
XFree
(
keymap
);
#endif
#endif
break
;
break
;
case
DEVICE_ON
:
case
DEVICE_ON
:
...
@@ -1182,7 +1183,7 @@ int nxagentResetKeyboard(void)
...
@@ -1182,7 +1183,7 @@ int nxagentResetKeyboard(void)
nxagentFreeKeyboardDeviceData
(
devBackup
);
nxagentFreeKeyboardDeviceData
(
devBackup
);
free
(
devBackup
);
SAFE_
free
(
devBackup
);
return
1
;
return
1
;
}
}
...
@@ -1315,18 +1316,15 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
...
@@ -1315,18 +1316,15 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
}
}
#endif
#endif
free
(
dev
->
key
->
curKeySyms
.
map
);
SAFE_free
(
dev
->
key
->
curKeySyms
.
map
);
free
(
dev
->
key
->
modifierKeyMap
);
SAFE_free
(
dev
->
key
->
modifierKeyMap
);
free
(
dev
->
key
);
SAFE_free
(
dev
->
key
);
dev
->
key
=
NULL
;
}
}
if
(
dev
->
focus
)
if
(
dev
->
focus
)
{
{
free
(
dev
->
focus
->
trace
);
SAFE_free
(
dev
->
focus
->
trace
);
free
(
dev
->
focus
);
SAFE_free
(
dev
->
focus
);
dev
->
focus
=
NULL
;
}
}
if
(
dev
->
kbdfeed
)
if
(
dev
->
kbdfeed
)
...
@@ -1338,7 +1336,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
...
@@ -1338,7 +1336,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
if
(
k
->
xkb_sli
)
if
(
k
->
xkb_sli
)
XkbFreeSrvLedInfo
(
k
->
xkb_sli
);
XkbFreeSrvLedInfo
(
k
->
xkb_sli
);
#endif
#endif
free
(
k
);
SAFE_
free
(
k
);
}
}
dev
->
kbdfeed
=
NULL
;
dev
->
kbdfeed
=
NULL
;
}
}
...
@@ -1571,11 +1569,11 @@ void nxagentTuneXkbWrapper(void)
...
@@ -1571,11 +1569,11 @@ void nxagentTuneXkbWrapper(void)
void
nxagentXkbClearNames
(
void
)
void
nxagentXkbClearNames
(
void
)
{
{
free
(
nxagentRemoteRules
);
nxagentRemoteRules
=
NULL
;
SAFE_free
(
nxagentRemoteRules
)
;
free
(
nxagentRemoteModel
);
nxagentRemoteModel
=
NULL
;
SAFE_free
(
nxagentRemoteModel
)
;
free
(
nxagentRemoteLayout
);
nxagentRemoteLayout
=
NULL
;
SAFE_free
(
nxagentRemoteLayout
)
;
free
(
nxagentRemoteVariant
);
nxagentRemoteVariant
=
NULL
;
SAFE_free
(
nxagentRemoteVariant
)
;
free
(
nxagentRemoteOptions
);
nxagentRemoteOptions
=
NULL
;
SAFE_free
(
nxagentRemoteOptions
)
;
}
}
static
void
nxagentXkbGetNames
(
void
)
static
void
nxagentXkbGetNames
(
void
)
...
@@ -1618,7 +1616,7 @@ static void nxagentXkbGetNames(void)
...
@@ -1618,7 +1616,7 @@ static void nxagentXkbGetNames(void)
{
{
if
(
data
)
if
(
data
)
{
{
XFree
(
data
);
SAFE_
XFree
(
data
);
return
;
return
;
}
}
}
}
...
@@ -1655,7 +1653,7 @@ static void nxagentXkbGetNames(void)
...
@@ -1655,7 +1653,7 @@ static void nxagentXkbGetNames(void)
name
+=
strlen
(
name
)
+
1
;
name
+=
strlen
(
name
)
+
1
;
}
}
XFree
(
data
);
SAFE_
XFree
(
data
);
return
;
return
;
}
}
...
@@ -1686,12 +1684,12 @@ static char* getKeyboardFilePath(void)
...
@@ -1686,12 +1684,12 @@ static char* getKeyboardFilePath(void)
{
{
if
((
asprintf
(
&
keyboard_file_path
,
"%s/keyboard"
,
sessionpath
)
==
-
1
))
if
((
asprintf
(
&
keyboard_file_path
,
"%s/keyboard"
,
sessionpath
)
==
-
1
))
{
{
free
(
sessionpath
);
SAFE_
free
(
sessionpath
);
FatalError
(
"malloc for keyboard file path failed."
);
FatalError
(
"malloc for keyboard file path failed."
);
}
}
else
else
{
{
free
(
sessionpath
);
SAFE_
free
(
sessionpath
);
}
}
}
}
else
else
...
@@ -1720,7 +1718,7 @@ static void nxagentWriteKeyboardDir(void)
...
@@ -1720,7 +1718,7 @@ static void nxagentWriteKeyboardDir(void)
{
{
fprintf
(
stderr
,
"Info: keyboard blocking directory created: '%s'
\n
"
,
keyboard_file_path
);
fprintf
(
stderr
,
"Info: keyboard blocking directory created: '%s'
\n
"
,
keyboard_file_path
);
}
}
free
(
keyboard_file_path
);
SAFE_
free
(
keyboard_file_path
);
}
}
}
}
...
@@ -1748,7 +1746,7 @@ static void nxagentWriteKeyboardFile(char *rules, char *model, char *layout, cha
...
@@ -1748,7 +1746,7 @@ static void nxagentWriteKeyboardFile(char *rules, char *model, char *layout, cha
int
save_err
=
errno
;
int
save_err
=
errno
;
fprintf
(
stderr
,
"Error: keyboard file not created: %s
\n
"
,
strerror
(
save_err
));
fprintf
(
stderr
,
"Error: keyboard file not created: %s
\n
"
,
strerror
(
save_err
));
}
}
free
(
keyboard_file_path
);
SAFE_
free
(
keyboard_file_path
);
}
}
}
}
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
View file @
6f80a06f
...
@@ -294,7 +294,7 @@ void nxagentInitKeystrokes(Bool force)
...
@@ -294,7 +294,7 @@ void nxagentInitKeystrokes(Bool force)
if
(
force
)
{
if
(
force
)
{
if
(
map
!=
default_map
)
if
(
map
!=
default_map
)
{
{
free
(
map
);
SAFE_
free
(
map
);
map
=
default_map
;
map
=
default_map
;
}
}
fprintf
(
stderr
,
"Info: re-reading keystrokes configuration
\n
"
);
fprintf
(
stderr
,
"Info: re-reading keystrokes configuration
\n
"
);
...
@@ -414,7 +414,7 @@ void nxagentInitKeystrokes(Bool force)
...
@@ -414,7 +414,7 @@ void nxagentInitKeystrokes(Bool force)
#endif
#endif
filename
=
NULL
;
filename
=
NULL
;
}
}
free
(
homepath
);
SAFE_
free
(
homepath
);
if
(
map
==
default_map
)
if
(
map
==
default_map
)
{
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
View file @
6f80a06f
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
#include "Events.h"
#include "Events.h"
#include "Holder.h"
#include "Holder.h"
#include "Args.h"
#include "Args.h"
#include "Utils.h"
#include "compext/Compext.h"
#include "compext/Compext.h"
#include <nx/NXpack.h>
#include <nx/NXpack.h>
...
@@ -501,7 +502,7 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap)
...
@@ -501,7 +502,7 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap)
FreeResource
(
pPixmapPriv
->
mid
,
RT_NONE
);
FreeResource
(
pPixmapPriv
->
mid
,
RT_NONE
);
}
}
free
(
pPixmap
);
SAFE_
free
(
pPixmap
);
return
True
;
return
True
;
}
}
...
@@ -1092,7 +1093,7 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
...
@@ -1092,7 +1093,7 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
{
{
FatalError
(
"XGetImage: Failed.
\n
"
);
FatalError
(
"XGetImage: Failed.
\n
"
);
free
(
data
);
SAFE_
free
(
data
);
return
False
;
return
False
;
}
}
...
@@ -1168,7 +1169,7 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
...
@@ -1168,7 +1169,7 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
XDestroyImage
(
image
);
XDestroyImage
(
image
);
}
}
free
(
data
);
SAFE_
free
(
data
);
}
}
else
else
{
{
...
@@ -1265,7 +1266,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
...
@@ -1265,7 +1266,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
nxagentPutImage
(
pDrawable
,
pGC
,
depth
,
xPict
,
yPict
,
nxagentPutImage
(
pDrawable
,
pGC
,
depth
,
xPict
,
yPict
,
width
,
height
,
0
,
format
,
data
);
width
,
height
,
0
,
format
,
data
);
free
(
data
);
SAFE_
free
(
data
);
}
}
#ifdef WARNING
#ifdef WARNING
else
else
...
@@ -1413,7 +1414,7 @@ FIXME: If the pixmap has a different depth from the window, the
...
@@ -1413,7 +1414,7 @@ FIXME: If the pixmap has a different depth from the window, the
fprintf
(
stderr
,
"nxagentPixmapOnShadowDisplay: XCreateImage failed.
\n
"
);
fprintf
(
stderr
,
"nxagentPixmapOnShadowDisplay: XCreateImage failed.
\n
"
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
return
False
;
return
False
;
}
}
...
@@ -1572,7 +1573,7 @@ Bool nxagentFbOnShadowDisplay(void)
...
@@ -1572,7 +1573,7 @@ Bool nxagentFbOnShadowDisplay(void)
fprintf
(
stderr
,
"nxagentFbOnShadowDisplay: XCreateImage failed.
\n
"
);
fprintf
(
stderr
,
"nxagentFbOnShadowDisplay: XCreateImage failed.
\n
"
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
return
False
;
return
False
;
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
6f80a06f
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
#include "Splash.h"
#include "Splash.h"
#include "Error.h"
#include "Error.h"
#include "Keystroke.h"
#include "Keystroke.h"
#include "Utils.h"
#ifdef XKB
#ifdef XKB
#include "XKBsrv.h"
#include "XKBsrv.h"
...
@@ -448,8 +449,7 @@ Bool nxagentReconnectSession(void)
...
@@ -448,8 +449,7 @@ Bool nxagentReconnectSession(void)
return
0
;
return
0
;
}
}
free
(
nxagentKeyboard
);
SAFE_free
(
nxagentKeyboard
);
nxagentKeyboard
=
NULL
;
}
}
nxagentSaveOptions
();
nxagentSaveOptions
();
...
@@ -464,7 +464,7 @@ Bool nxagentReconnectSession(void)
...
@@ -464,7 +464,7 @@ Bool nxagentReconnectSession(void)
fprintf
(
stderr
,
"nxagentReconnect: changing nxagentKeyboard from [null/null] to [clone].
\n
"
);
fprintf
(
stderr
,
"nxagentReconnect: changing nxagentKeyboard from [null/null] to [clone].
\n
"
);
#endif
#endif
free
(
nxagentKeyboard
);
SAFE_
free
(
nxagentKeyboard
);
nxagentKeyboard
=
strdup
(
"clone"
);
nxagentKeyboard
=
strdup
(
"clone"
);
}
}
...
@@ -635,8 +635,7 @@ Bool nxagentReconnectSession(void)
...
@@ -635,8 +635,7 @@ Bool nxagentReconnectSession(void)
nxagentXkbState
.
Initialized
=
0
;
nxagentXkbState
.
Initialized
=
0
;
free
(
nxagentOldKeyboard
);
SAFE_free
(
nxagentOldKeyboard
);
nxagentOldKeyboard
=
NULL
;
nxagentInitPointerMap
();
nxagentInitPointerMap
();
...
@@ -760,8 +759,7 @@ nxagentReconnectError:
...
@@ -760,8 +759,7 @@ nxagentReconnectError:
nxagentDisconnectDisplay
();
nxagentDisconnectDisplay
();
}
}
free
(
nxagentOldKeyboard
);
SAFE_free
(
nxagentOldKeyboard
);
nxagentOldKeyboard
=
NULL
;
return
0
;
return
0
;
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Render.c
View file @
6f80a06f
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include "Drawable.h"
#include "Drawable.h"
#include "Trap.h"
#include "Trap.h"
#include "Args.h"
#include "Args.h"
#include "Utils.h"
#define Atom XlibAtom
#define Atom XlibAtom
#define Pixmap XlibPixmap
#define Pixmap XlibPixmap
...
@@ -2528,7 +2529,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
...
@@ -2528,7 +2529,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
if
(
normalizedImages
!=
images
)
if
(
normalizedImages
!=
images
)
{
{
free
(
normalizedImages
);
SAFE_
free
(
normalizedImages
);
}
}
#ifdef DEBUG
#ifdef DEBUG
...
@@ -2636,7 +2637,7 @@ FIXME: Is this useful or just a waste of bandwidth?
...
@@ -2636,7 +2637,7 @@ FIXME: Is this useful or just a waste of bandwidth?
nparams
);
nparams
);
#endif
#endif
free
(
szFilter
);
SAFE_
free
(
szFilter
);
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
6f80a06f
...
@@ -281,10 +281,7 @@ Bool nxagentRootlessTreesMatch(void)
...
@@ -281,10 +281,7 @@ Bool nxagentRootlessTreesMatch(void)
}
}
}
}
if
(
children_return
)
SAFE_XFree
(
children_return
);
{
XFree
(
children_return
);
}
return
treesMatch
;
return
treesMatch
;
}
}
...
@@ -332,7 +329,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
...
@@ -332,7 +329,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
if
(
!
ntoplevel
)
if
(
!
ntoplevel
)
{
{
free
(
toplevel
);
SAFE_
free
(
toplevel
);
return
;
return
;
}
}
...
@@ -397,7 +394,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
...
@@ -397,7 +394,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
#endif
#endif
free
(
toplevel
);
SAFE_
free
(
toplevel
);
return
;
return
;
}
}
...
@@ -818,7 +815,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -818,7 +815,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if
(
freeMem
)
if
(
freeMem
)
{
{
free
(
output
);
SAFE_
free
(
output
);
}
}
return
export
;
return
export
;
...
@@ -1131,7 +1128,7 @@ void nxagentImportProperty(Window window,
...
@@ -1131,7 +1128,7 @@ void nxagentImportProperty(Window window,
if
(
freeMem
)
if
(
freeMem
)
{
{
free
(
output
);
SAFE_
free
(
output
);
}
}
return
;
return
;
...
@@ -1183,7 +1180,7 @@ void nxagentRemovePropertyFromList(void)
...
@@ -1183,7 +1180,7 @@ void nxagentRemovePropertyFromList(void)
nxagentPropertyList
.
last
=
NULL
;
nxagentPropertyList
.
last
=
NULL
;
}
}
free
(
tmp
);
SAFE_
free
(
tmp
);
}
}
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
6f80a06f
...
@@ -302,8 +302,7 @@ Bool nxagentIsParentOf(Display *d, XlibWindow possible_parent, XlibWindow candid
...
@@ -302,8 +302,7 @@ Bool nxagentIsParentOf(Display *d, XlibWindow possible_parent, XlibWindow candid
if
(
XQueryTree
(
d
,
candidate
,
&
root
,
&
parent
,
&
children
,
&
num_children
))
if
(
XQueryTree
(
d
,
candidate
,
&
root
,
&
parent
,
&
children
,
&
num_children
))
{
{
if
(
children
)
SAFE_XFree
(
children
);
XFree
((
char
*
)
children
);
#ifdef TEST
#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
);
fprintf
(
stderr
,
"%s: parent of full screen window [%p] root [%p] possible_parent [%p] candidate [%p]
\n
"
,
__func__
,
parent
,
root
,
possible_parent
,
candidate
);
...
@@ -484,11 +483,8 @@ Window nxagentCreateIconWindow(void)
...
@@ -484,11 +483,8 @@ Window nxagentCreateIconWindow(void)
window_name
,
window_name
,
window_name
,
window_name
,
NULL
,
0
,
sizeHints
,
wmHints
,
NULL
);
NULL
,
0
,
sizeHints
,
wmHints
,
NULL
);
if
(
sizeHints
)
SAFE_XFree
(
sizeHints
);
XFree
(
sizeHints
);
SAFE_XFree
(
wmHints
);
if
(
wmHints
)
XFree
(
wmHints
);
/*
/*
* Enable events from the icon window.
* Enable events from the icon window.
...
@@ -889,10 +885,9 @@ void freeDepths(DepthPtr depths, int num)
...
@@ -889,10 +885,9 @@ void freeDepths(DepthPtr depths, int num)
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"%s: freeing depth [%d] index [%d] vids [%p]
\n
"
,
__func__
,
depths
[
i
].
depth
,
i
,
(
void
*
)
depths
[
i
].
vids
);
fprintf
(
stderr
,
"%s: freeing depth [%d] index [%d] vids [%p]
\n
"
,
__func__
,
depths
[
i
].
depth
,
i
,
(
void
*
)
depths
[
i
].
vids
);
#endif
#endif
free
(
depths
[
i
].
vids
);
SAFE_free
(
depths
[
i
].
vids
);
depths
[
i
].
vids
=
NULL
;
}
}
free
(
depths
);
SAFE_
free
(
depths
);
}
}
Bool
nxagentOpenScreen
(
ScreenPtr
pScreen
,
Bool
nxagentOpenScreen
(
ScreenPtr
pScreen
,
...
@@ -1387,7 +1382,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
...
@@ -1387,7 +1382,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
if
(
!
pFrameBufferBits
)
if
(
!
pFrameBufferBits
)
{
{
freeDepths
(
depths
,
numDepths
);
freeDepths
(
depths
,
numDepths
);
free
(
visuals
);
SAFE_
free
(
visuals
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -1410,7 +1405,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
...
@@ -1410,7 +1405,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
monitorResolution
,
monitorResolution
,
PixmapBytePad
(
nxagentOption
(
RootWidth
),
rootDepth
),
bitsPerPixel
))
monitorResolution
,
monitorResolution
,
PixmapBytePad
(
nxagentOption
(
RootWidth
),
rootDepth
),
bitsPerPixel
))
{
{
freeDepths
(
depths
,
numDepths
);
freeDepths
(
depths
,
numDepths
);
free
(
visuals
);
SAFE_
free
(
visuals
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -1451,7 +1446,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
...
@@ -1451,7 +1446,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
pScreen
->
numDepths
=
numDepths
;
pScreen
->
numDepths
=
numDepths
;
pScreen
->
rootDepth
=
rootDepth
;
pScreen
->
rootDepth
=
rootDepth
;
free
(
pScreen
->
visuals
);
SAFE_
free
(
pScreen
->
visuals
);
pScreen
->
visuals
=
visuals
;
pScreen
->
visuals
=
visuals
;
pScreen
->
numVisuals
=
numVisuals
;
pScreen
->
numVisuals
=
numVisuals
;
pScreen
->
rootVisual
=
defaultVisual
;
pScreen
->
rootVisual
=
defaultVisual
;
...
@@ -1892,8 +1887,8 @@ N/A
...
@@ -1892,8 +1887,8 @@ N/A
hint
.
res_class
=
strdup
(
"NXAgent"
);
hint
.
res_class
=
strdup
(
"NXAgent"
);
}
}
XSetClassHint
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
&
hint
);
XSetClassHint
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
&
hint
);
free
(
hint
.
res_name
);
SAFE_
free
(
hint
.
res_name
);
free
(
hint
.
res_class
);
SAFE_
free
(
hint
.
res_class
);
}
}
if
(
nxagentOption
(
Fullscreen
))
if
(
nxagentOption
(
Fullscreen
))
...
@@ -1977,17 +1972,8 @@ N/A
...
@@ -1977,17 +1972,8 @@ N/A
nxagentWindowName
,
nxagentWindowName
,
argv
,
argc
,
sizeHints
,
wmHints
,
NULL
);
argv
,
argc
,
sizeHints
,
wmHints
,
NULL
);
if
(
sizeHints
)
SAFE_XFree
(
sizeHints
);
{
SAFE_XFree
(
wmHints
);
XFree
(
sizeHints
);
sizeHints
=
NULL
;
}
if
(
wmHints
)
{
XFree
(
wmHints
);
wmHints
=
NULL
;
}
/*
/*
* Clear the window but let it unmapped. We'll map it
* Clear the window but let it unmapped. We'll map it
...
@@ -2199,9 +2185,9 @@ Bool nxagentCloseScreen(ScreenPtr pScreen)
...
@@ -2199,9 +2185,9 @@ Bool nxagentCloseScreen(ScreenPtr pScreen)
* Free the frame buffer.
* Free the frame buffer.
*/
*/
free
(((
PixmapPtr
)
pScreen
->
devPrivate
)
->
devPrivate
.
ptr
);
SAFE_
free
(((
PixmapPtr
)
pScreen
->
devPrivate
)
->
devPrivate
.
ptr
);
free
(
pScreen
->
devPrivate
);
pScreen
->
devPrivate
=
NULL
;
SAFE_free
(
pScreen
->
devPrivate
)
;
free
(
pScreen
->
visuals
);
pScreen
->
visuals
=
NULL
;
SAFE_free
(
pScreen
->
visuals
)
;
fbCloseScreen
(
pScreen
);
fbCloseScreen
(
pScreen
);
...
@@ -3158,7 +3144,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
...
@@ -3158,7 +3144,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
length
=
nxagentImageLength
(
width
,
height
,
ZPixmap
,
0
,
nxagentMasterDepth
);
length
=
nxagentImageLength
(
width
,
height
,
ZPixmap
,
0
,
nxagentMasterDepth
);
free
(
tBuffer
);
SAFE_
free
(
tBuffer
);
tBuffer
=
malloc
(
length
);
tBuffer
=
malloc
(
length
);
...
@@ -3215,7 +3201,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
...
@@ -3215,7 +3201,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
RegionUnion
(
&
nxagentShadowUpdateRegion
,
&
nxagentShadowUpdateRegion
,
&
updateRegion
);
RegionUnion
(
&
nxagentShadowUpdateRegion
,
&
nxagentShadowUpdateRegion
,
&
updateRegion
);
}
}
free
(
tBuffer
);
SAFE_
free
(
tBuffer
);
RegionUninit
(
&
updateRegion
);
RegionUninit
(
&
updateRegion
);
}
}
...
@@ -3433,7 +3419,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
...
@@ -3433,7 +3419,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
cBuffer
=
(
unsigned
char
*
)
*
buffer
;
cBuffer
=
(
unsigned
char
*
)
*
buffer
;
*
buffer
=
(
char
*
)
icBuffer
;
*
buffer
=
(
char
*
)
icBuffer
;
free
(
cBuffer
);
SAFE_
free
(
cBuffer
);
}
}
#ifdef NXAGENT_ARTSD
#ifdef NXAGENT_ARTSD
...
@@ -3616,7 +3602,7 @@ FIXME: The port information is not used at the moment and produces a
...
@@ -3616,7 +3602,7 @@ FIXME: The port information is not used at the moment and produces a
strlen
(
local_buf
),
local_buf
,
1
);
strlen
(
local_buf
),
local_buf
,
1
);
}
}
free
(
local_buf
);
SAFE_
free
(
local_buf
);
}
}
}
}
}
}
...
@@ -4040,7 +4026,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4040,7 +4026,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
#endif
#endif
number
=
1
;
number
=
1
;
free
(
screeninfo
);
SAFE_
free
(
screeninfo
);
if
(
!
(
screeninfo
=
malloc
(
sizeof
(
XineramaScreenInfo
))))
{
if
(
!
(
screeninfo
=
malloc
(
sizeof
(
XineramaScreenInfo
))))
{
return
FALSE
;
return
FALSE
;
...
@@ -4309,8 +4295,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4309,8 +4295,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
}
}
/* release allocated memory */
/* release allocated memory */
free
(
screeninfo
);
SAFE_free
(
screeninfo
);
screeninfo
=
NULL
;
#ifdef DEBUG
#ifdef DEBUG
for
(
i
=
0
;
i
<
pScrPriv
->
numCrtcs
;
i
++
)
{
for
(
i
=
0
;
i
<
pScrPriv
->
numCrtcs
;
i
++
)
{
...
@@ -4425,7 +4410,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
...
@@ -4425,7 +4410,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
XSetClipRectangles
(
nxagentDisplay
,
gc
,
0
,
0
,
pRects
,
nRects
,
Unsorted
);
XSetClipRectangles
(
nxagentDisplay
,
gc
,
0
,
0
,
pRects
,
nRects
,
Unsorted
);
free
((
char
*
)
pRects
);
SAFE_free
(
pRects
);
extents
=
*
RegionExtents
(
&
cleanRegion
);
extents
=
*
RegionExtents
(
&
cleanRegion
);
...
@@ -4571,7 +4556,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
...
@@ -4571,7 +4556,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
XSetClipRectangles
(
nxagentDisplay
,
gc
,
0
,
0
,
pRects
,
nRects
,
Unsorted
);
XSetClipRectangles
(
nxagentDisplay
,
gc
,
0
,
0
,
pRects
,
nRects
,
Unsorted
);
free
(
pRects
);
SAFE_
free
(
pRects
);
extents
=
*
RegionExtents
(
clipRegion
);
extents
=
*
RegionExtents
(
clipRegion
);
...
@@ -4651,7 +4636,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
...
@@ -4651,7 +4636,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
screen
],
sizeHints
);
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
screen
],
sizeHints
);
XFree
(
sizeHints
);
SAFE_
XFree
(
sizeHints
);
}
}
/*
/*
...
@@ -4670,7 +4655,7 @@ void nxagentSetWMNormalHintsMaxsize(ScreenPtr pScreen, int maxwidth, int maxheig
...
@@ -4670,7 +4655,7 @@ void nxagentSetWMNormalHintsMaxsize(ScreenPtr pScreen, int maxwidth, int maxheig
sizeHints
->
max_height
=
maxheight
;
sizeHints
->
max_height
=
maxheight
;
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
sizeHints
);
sizeHints
);
XFree
(
sizeHints
);
SAFE_
XFree
(
sizeHints
);
}
}
}
}
...
@@ -4811,7 +4796,7 @@ FIXME
...
@@ -4811,7 +4796,7 @@ FIXME
fprintf
(
stderr
,
"nxagentShowPixmap: XGetImage failed.
\n
"
);
fprintf
(
stderr
,
"nxagentShowPixmap: XGetImage failed.
\n
"
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
return
;
return
;
}
}
...
@@ -4844,7 +4829,7 @@ FIXME
...
@@ -4844,7 +4829,7 @@ FIXME
XDestroyImage
(
image
);
XDestroyImage
(
image
);
}
}
free
(
data
);
SAFE_
free
(
data
);
/*
/*
FIXME
FIXME
...
@@ -4896,7 +4881,7 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc,
...
@@ -4896,7 +4881,7 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc,
fprintf
(
stderr
,
"nxagentFbRestoreArea: XGetImage failed.
\n
"
);
fprintf
(
stderr
,
"nxagentFbRestoreArea: XGetImage failed.
\n
"
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
return
;
return
;
}
}
...
@@ -4956,7 +4941,7 @@ FIXME
...
@@ -4956,7 +4941,7 @@ FIXME
/*
/*
FIXME
FIXME
free(data);
SAFE_
free(data);
*/
*/
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Utils.h
View file @
6f80a06f
...
@@ -45,5 +45,6 @@ static inline const char * validateString(const char *str) {
...
@@ -45,5 +45,6 @@ static inline const char * validateString(const char *str) {
}
}
#define SAFE_XFree(what) do {if (what) {XFree(what); what = NULL;}} while (0)
#define SAFE_XFree(what) do {if (what) {XFree(what); what = NULL;}} while (0)
#define SAFE_free(what) do {free(what); what = NULL;} while (0)
#endif
/* __Utils_H__ */
#endif
/* __Utils_H__ */
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
6f80a06f
...
@@ -63,6 +63,7 @@
...
@@ -63,6 +63,7 @@
#include "Init.h"
#include "Init.h"
#include "Composite.h"
#include "Composite.h"
#include "Events.h"
#include "Events.h"
#include "Utils.h"
#include <nx/NX.h>
#include <nx/NX.h>
#include "compext/Compext.h"
#include "compext/Compext.h"
...
@@ -1430,10 +1431,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
...
@@ -1430,10 +1431,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
fprintf
(
stderr
,
"nxagentConfigureWindow: Failed QueryTree request.
\n
"
);
fprintf
(
stderr
,
"nxagentConfigureWindow: Failed QueryTree request.
\n
"
);
}
}
if
(
children_return
)
SAFE_XFree
(
children_return
);
{
XFree
(
children_return
);
}
}
}
#endif
#endif
}
}
...
@@ -3129,7 +3127,7 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
...
@@ -3129,7 +3127,7 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
&
hints
);
&
hints
);
#ifdef _XSERVER64
#ifdef _XSERVER64
free
(
data64
);
SAFE_
free
(
data64
);
#endif
#endif
}
}
}
}
...
@@ -3376,7 +3374,7 @@ Bool nxagentCheckWindowIntegrity(WindowPtr pWin)
...
@@ -3376,7 +3374,7 @@ Bool nxagentCheckWindowIntegrity(WindowPtr pWin)
XDestroyImage
(
image
);
XDestroyImage
(
image
);
}
}
free
(
data
);
SAFE_
free
(
data
);
}
}
else
else
{
{
...
@@ -3465,14 +3463,14 @@ void nxagentFlushConfigureWindow(void)
...
@@ -3465,14 +3463,14 @@ void nxagentFlushConfigureWindow(void)
if
(
index
==
nxagentConfiguredWindowList
)
if
(
index
==
nxagentConfiguredWindowList
)
{
{
free
(
index
);
SAFE_
free
(
index
);
break
;
break
;
}
}
else
else
{
{
ConfiguredWindowStruct
*
tmp
=
index
;
ConfiguredWindowStruct
*
tmp
=
index
;
index
=
index
->
prev
;
index
=
index
->
prev
;
free
(
tmp
);
SAFE_
free
(
tmp
);
}
}
}
}
...
@@ -3622,16 +3620,14 @@ void nxagentDeleteConfiguredWindow(WindowPtr pWin)
...
@@ -3622,16 +3620,14 @@ void nxagentDeleteConfiguredWindow(WindowPtr pWin)
{
{
if
(
index
->
prev
==
NULL
&&
index
->
next
==
NULL
)
if
(
index
->
prev
==
NULL
&&
index
->
next
==
NULL
)
{
{
free
(
nxagentConfiguredWindowList
);
SAFE_free
(
nxagentConfiguredWindowList
);
nxagentConfiguredWindowList
=
NULL
;
return
;
return
;
}
}
else
if
(
index
->
prev
==
NULL
)
else
if
(
index
->
prev
==
NULL
)
{
{
tmp
=
nxagentConfiguredWindowList
;
tmp
=
nxagentConfiguredWindowList
;
index
=
nxagentConfiguredWindowList
=
tmp
->
next
;
index
=
nxagentConfiguredWindowList
=
tmp
->
next
;
free
(
tmp
);
SAFE_
free
(
tmp
);
nxagentConfiguredWindowList
->
prev
=
NULL
;
nxagentConfiguredWindowList
->
prev
=
NULL
;
continue
;
continue
;
...
@@ -3640,7 +3636,7 @@ void nxagentDeleteConfiguredWindow(WindowPtr pWin)
...
@@ -3640,7 +3636,7 @@ void nxagentDeleteConfiguredWindow(WindowPtr pWin)
{
{
tmp
=
index
;
tmp
=
index
;
index
=
index
->
prev
;
index
=
index
->
prev
;
free
(
tmp
);
SAFE_
free
(
tmp
);
index
->
next
=
NULL
;
index
->
next
=
NULL
;
return
;
return
;
...
@@ -3651,7 +3647,7 @@ void nxagentDeleteConfiguredWindow(WindowPtr pWin)
...
@@ -3651,7 +3647,7 @@ void nxagentDeleteConfiguredWindow(WindowPtr pWin)
index
=
index
->
next
;
index
=
index
->
next
;
previous
->
next
=
index
;
previous
->
next
=
index
;
index
->
prev
=
previous
;
index
->
prev
=
previous
;
free
(
tmp
);
SAFE_
free
(
tmp
);
continue
;
continue
;
}
}
...
@@ -3693,16 +3689,14 @@ void nxagentDeleteStaticResizedWindow(unsigned long sequence)
...
@@ -3693,16 +3689,14 @@ void nxagentDeleteStaticResizedWindow(unsigned long sequence)
{
{
if
(
index
->
prev
==
NULL
&&
index
->
next
==
NULL
)
if
(
index
->
prev
==
NULL
&&
index
->
next
==
NULL
)
{
{
free
(
nxagentStaticResizedWindowList
);
SAFE_free
(
nxagentStaticResizedWindowList
);
nxagentStaticResizedWindowList
=
NULL
;
return
;
return
;
}
}
else
if
(
index
->
prev
==
NULL
)
else
if
(
index
->
prev
==
NULL
)
{
{
tmp
=
nxagentStaticResizedWindowList
;
tmp
=
nxagentStaticResizedWindowList
;
index
=
nxagentStaticResizedWindowList
=
tmp
->
next
;
index
=
nxagentStaticResizedWindowList
=
tmp
->
next
;
free
(
tmp
);
SAFE_
free
(
tmp
);
nxagentStaticResizedWindowList
->
prev
=
NULL
;
nxagentStaticResizedWindowList
->
prev
=
NULL
;
continue
;
continue
;
...
@@ -3711,7 +3705,7 @@ void nxagentDeleteStaticResizedWindow(unsigned long sequence)
...
@@ -3711,7 +3705,7 @@ void nxagentDeleteStaticResizedWindow(unsigned long sequence)
{
{
tmp
=
index
;
tmp
=
index
;
index
=
index
->
prev
;
index
=
index
->
prev
;
free
(
tmp
);
SAFE_
free
(
tmp
);
index
->
next
=
NULL
;
index
->
next
=
NULL
;
return
;
return
;
...
@@ -3722,7 +3716,7 @@ void nxagentDeleteStaticResizedWindow(unsigned long sequence)
...
@@ -3722,7 +3716,7 @@ void nxagentDeleteStaticResizedWindow(unsigned long sequence)
index
=
index
->
next
;
index
=
index
->
next
;
previous
->
next
=
index
;
previous
->
next
=
index
;
index
->
prev
=
previous
;
index
->
prev
=
previous
;
free
(
tmp
);
SAFE_
free
(
tmp
);
continue
;
continue
;
}
}
...
@@ -3855,8 +3849,7 @@ int nxagentRemoveItemBSPixmapList(unsigned long pixmapId)
...
@@ -3855,8 +3849,7 @@ int nxagentRemoveItemBSPixmapList(unsigned long pixmapId)
if
((
nxagentBSPixmapList
[
i
]
!=
NULL
)
&&
if
((
nxagentBSPixmapList
[
i
]
!=
NULL
)
&&
(
nxagentBSPixmapList
[
i
]
->
storingPixmapId
==
pixmapId
))
(
nxagentBSPixmapList
[
i
]
->
storingPixmapId
==
pixmapId
))
{
{
free
(
nxagentBSPixmapList
[
i
]);
SAFE_free
(
nxagentBSPixmapList
[
i
]);
nxagentBSPixmapList
[
i
]
=
NULL
;
if
(
i
<
BSPIXMAPLIMIT
-
1
)
if
(
i
<
BSPIXMAPLIMIT
-
1
)
{
{
...
@@ -3894,8 +3887,7 @@ int nxagentEmptyBSPixmapList(void)
...
@@ -3894,8 +3887,7 @@ int nxagentEmptyBSPixmapList(void)
{
{
for
(
int
i
=
0
;
i
<
BSPIXMAPLIMIT
;
i
++
)
for
(
int
i
=
0
;
i
<
BSPIXMAPLIMIT
;
i
++
)
{
{
free
(
nxagentBSPixmapList
[
i
]);
SAFE_free
(
nxagentBSPixmapList
[
i
]);
nxagentBSPixmapList
[
i
]
=
NULL
;
}
}
return
1
;
return
1
;
...
...
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