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
ce182e88
Unverified
Commit
ce182e88
authored
Nov 21, 2017
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/simplify_free' into 3.6.x
Attributes GH PR #555:
https://github.com/ArcticaProject/nx-libs/pull/555
parents
3b640a0f
dc43f4c9
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
58 additions
and
185 deletions
+58
-185
Args.c
nx-X11/programs/Xserver/hw/nxagent/Args.c
+2
-6
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+4
-10
Colormap.c
nx-X11/programs/Xserver/hw/nxagent/Colormap.c
+3
-5
Drawable.c
nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+8
-20
Error.c
nx-X11/programs/Xserver/hw/nxagent/Error.c
+8
-31
Font.c
nx-X11/programs/Xserver/hw/nxagent/Font.c
+7
-22
GC.c
nx-X11/programs/Xserver/hw/nxagent/GC.c
+1
-4
GCOps.c
nx-X11/programs/Xserver/hw/nxagent/GCOps.c
+1
-4
Image.c
nx-X11/programs/Xserver/hw/nxagent/Image.c
+2
-9
Pixmap.c
nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+3
-12
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+4
-12
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+11
-35
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+4
-15
No files found.
nx-X11/programs/Xserver/hw/nxagent/Args.c
View file @
ce182e88
...
...
@@ -729,12 +729,8 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
int
size
;
if
(
nxagentKeyboard
!=
NULL
)
{
free
(
nxagentKeyboard
);
nxagentKeyboard
=
NULL
;
}
free
(
nxagentKeyboard
);
nxagentKeyboard
=
NULL
;
if
((
size
=
strlen
(
argv
[
i
]))
<
256
)
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
ce182e88
...
...
@@ -974,11 +974,8 @@ void nxagentNotifySelection(XEvent *X)
}
/*
* if (pszReturnData)
* {
* free(pszReturnData);
* pszReturnData=NULL;
* }
* free(pszReturnData);
* pszReturnData=NULL;
*/
}
...
...
@@ -1500,11 +1497,8 @@ int nxagentInitClipboard(WindowPtr pWin)
fprintf
(
stderr
,
"nxagentInitClipboard: Got called.
\n
"
);
#endif
if
(
lastSelectionOwner
!=
NULL
)
{
free
(
lastSelectionOwner
);
lastSelectionOwner
=
NULL
;
}
free
(
lastSelectionOwner
);
lastSelectionOwner
=
NULL
;
lastSelectionOwner
=
(
SelectionOwner
*
)
malloc
(
2
*
sizeof
(
SelectionOwner
));
...
...
nx-X11/programs/Xserver/hw/nxagent/Colormap.c
View file @
ce182e88
...
...
@@ -257,8 +257,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
free
(
icws
.
cmapIDs
);
if
(
!
nxagentSameInstalledColormapWindows
(
icws
.
windows
,
icws
.
numWindows
))
{
if
(
nxagentOldInstalledColormapWindows
)
free
(
nxagentOldInstalledColormapWindows
);
free
(
nxagentOldInstalledColormapWindows
);
#ifdef _XSERVER64
{
...
...
@@ -318,13 +317,12 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
#endif
/* DUMB_WINDOW_MANAGERS */
}
else
if
(
icws
.
windows
)
free
(
icws
.
windows
);
free
(
icws
.
windows
);
}
void
nxagentSetScreenSaverColormapWindow
(
ScreenPtr
pScreen
)
{
if
(
nxagentOldInstalledColormapWindows
)
free
(
nxagentOldInstalledColormapWindows
);
free
(
nxagentOldInstalledColormapWindows
);
#ifdef _XSERVER64
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Drawable.c
View file @
ce182e88
...
...
@@ -264,7 +264,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
success
=
0
;
goto
nxagentSynchronizeDrawableData
Free
;
goto
nxagentSynchronizeDrawableData
End
;
}
ValidateGC
(
pDrawable
,
pGC
);
...
...
@@ -282,7 +282,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
success
=
1
;
goto
nxagentSynchronizeDrawableData
Free
;
goto
nxagentSynchronizeDrawableData
End
;
}
else
if
(
nxagentReconnectTrap
==
1
)
{
...
...
@@ -323,7 +323,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
success
=
0
;
goto
nxagentSynchronizeDrawableData
Free
;
goto
nxagentSynchronizeDrawableData
End
;
}
ValidateGC
(
pDrawable
,
pGC
);
...
...
@@ -336,7 +336,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
success
=
1
;
goto
nxagentSynchronizeDrawableData
Free
;
goto
nxagentSynchronizeDrawableData
End
;
}
else
{
...
...
@@ -349,7 +349,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
success
=
1
;
goto
nxagentSynchronizeDrawableData
Free
;
goto
nxagentSynchronizeDrawableData
End
;
}
}
}
...
...
@@ -363,14 +363,8 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
success
=
nxagentSynchronizeRegion
(
pDrawable
,
NullRegion
,
breakMask
,
owner
);
nxagentSynchronizeDrawableDataFree:
if
(
data
!=
NULL
)
{
free
(
data
);
}
nxagentSynchronizeDrawableDataEnd:
free
(
data
);
return
success
;
}
...
...
@@ -866,10 +860,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
#endif
}
if
(
cmpData
!=
NULL
)
{
free
(
cmpData
);
}
free
(
cmpData
);
}
}
else
...
...
@@ -1066,10 +1057,7 @@ nxagentSynchronizeRegionFree:
nxagentFreeRegion
(
pDrawable
,
clipRegion
);
}
if
(
data
!=
NULL
)
{
free
(
data
);
}
free
(
data
);
RegionUninit
(
&
exposeRegion
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Error.c
View file @
ce182e88
...
...
@@ -98,7 +98,7 @@ static char nxagentRootDir[DEFAULT_STRING_LENGTH] = { 0 };
static
char
nxagentSessionDir
[
DEFAULT_STRING_LENGTH
]
=
{
0
};
char
*
nxagentGetClientsPath
(
void
);
void
nxagentGetClientsPath
(
void
);
static
int
nxagentPrintError
(
Display
*
dpy
,
XErrorEvent
*
event
,
FILE
*
fp
);
...
...
@@ -247,16 +247,9 @@ int nxagentExitHandler(const char *message)
void
nxagentOpenClientsLogFile
()
{
char
*
clientsLogName
;
if
(
*
nxagentClientsLogName
==
'\0'
)
{
clientsLogName
=
nxagentGetClientsPath
();
if
(
clientsLogName
!=
NULL
)
{
free
(
clientsLogName
);
}
nxagentGetClientsPath
();
}
if
(
nxagentClientsLogName
!=
NULL
&&
*
nxagentClientsLogName
!=
'\0'
)
...
...
@@ -593,30 +586,27 @@ char *nxagentGetSessionPath(void)
return
sessionPath
;
}
char
*
nxagentGetClientsPath
()
void
nxagentGetClientsPath
()
{
char
*
sessionPath
;
char
*
clientsPath
;
if
(
*
nxagentClientsLogName
==
'\0'
)
{
sessionPath
=
nxagentGetSessionPath
();
char
*
sessionPath
=
nxagentGetSessionPath
();
if
(
sessionPath
==
NULL
)
{
return
NULL
;
return
;
}
if
(
strlen
(
sessionPath
)
+
strlen
(
"/clients"
)
>
DEFAULT_STRING_LENGTH
-
1
)
{
#ifdef PANIC
fprintf
(
stderr
,
"nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path '%s'.
\n
"
,
nxagentClientsLogName
);
fprintf
(
stderr
,
"nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path ''.
\n
"
);
#endif
free
(
sessionPath
);
return
NULL
;
return
;
}
strcpy
(
nxagentClientsLogName
,
sessionPath
);
...
...
@@ -626,19 +616,6 @@ char *nxagentGetClientsPath()
free
(
sessionPath
);
}
clientsPath
=
malloc
(
strlen
(
nxagentClientsLogName
)
+
1
);
if
(
clientsPath
==
NULL
)
{
#ifdef PANIC
fprintf
(
stderr
,
"nxagentGetClientsPath: PANIC! Can't allocate memory for the clients Log File Path path.
\n
"
);
#endif
return
NULL
;
}
strcpy
(
clientsPath
,
nxagentClientsLogName
);
return
clientsPath
;
return
;
}
nx-X11/programs/Xserver/hw/nxagent/Font.c
View file @
ce182e88
...
...
@@ -841,10 +841,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
for
(
j
=
0
;
j
<
numSearchFields
;
j
++
)
{
if
(
searchFields
[
j
]
!=
NULL
)
{
free
(
searchFields
[
j
]);
}
free
(
searchFields
[
j
]);
}
}
}
...
...
@@ -863,10 +860,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
for
(
j
=
0
;
j
<
numFontFields
;
j
++
)
{
if
(
fontNameFields
[
j
]
!=
NULL
)
{
free
(
fontNameFields
[
j
]);
}
free
(
fontNameFields
[
j
]);
}
return
fontStruct
;
...
...
@@ -1260,17 +1254,11 @@ static void nxagentFailedFontReconnect(FontPtr pFont, XID param1, void * param2)
static
void
nxagentFreeFailedToReconnectFonts
()
{
if
(
nxagentFailedToReconnectFonts
.
font
!=
NULL
)
{
free
(
nxagentFailedToReconnectFonts
.
font
);
nxagentFailedToReconnectFonts
.
font
=
NULL
;
}
free
(
nxagentFailedToReconnectFonts
.
font
);
nxagentFailedToReconnectFonts
.
font
=
NULL
;
if
(
nxagentFailedToReconnectFonts
.
id
!=
NULL
)
{
free
(
nxagentFailedToReconnectFonts
.
id
);
nxagentFailedToReconnectFonts
.
id
=
NULL
;
}
free
(
nxagentFailedToReconnectFonts
.
id
);
nxagentFailedToReconnectFonts
.
id
=
NULL
;
nxagentFailedToReconnectFonts
.
size
=
0
;
nxagentFailedToReconnectFonts
.
index
=
0
;
...
...
@@ -1706,10 +1694,7 @@ int nxagentFreeFont(XFontStruct *fs)
#endif
}
if
(
fs
->
properties
)
{
free
(
fs
->
properties
);
}
free
(
fs
->
properties
);
XFree
(
fs
);
...
...
nx-X11/programs/Xserver/hw/nxagent/GC.c
View file @
ce182e88
...
...
@@ -924,10 +924,7 @@ static void nxagentRestoreGCRec(struct nxagentGCRec *t)
(
void
*
)
t
,
(
void
*
)
t
->
gc
);
#endif
if
(
nxagentGC
(
t
->
pGC
))
{
free
(
nxagentGC
(
t
->
pGC
));
}
free
(
nxagentGC
(
t
->
pGC
));
nxagentGC
(
t
->
pGC
)
=
t
->
gc
;
...
...
nx-X11/programs/Xserver/hw/nxagent/GCOps.c
View file @
ce182e88
...
...
@@ -1545,10 +1545,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
RESET_GC_TRAP
();
}
if
(
newPoints
!=
NULL
)
{
free
(
newPoints
);
}
free
(
newPoints
);
}
void
nxagentPolyFillRect
(
DrawablePtr
pDrawable
,
GCPtr
pGC
,
...
...
nx-X11/programs/Xserver/hw/nxagent/Image.c
View file @
ce182e88
...
...
@@ -1567,10 +1567,7 @@ nxagentPutSubImageEnd:
nxagentImageStatistics
.
totalEncoded
,
nxagentImageStatistics
.
totalAdded
);
#endif
if
(
packedChecksum
!=
NULL
)
{
free
(
packedChecksum
);
}
free
(
packedChecksum
);
if
(
packedImage
!=
NULL
)
{
...
...
@@ -1787,11 +1784,7 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
}
}
if
(
image
->
obdata
!=
NULL
)
{
free
((
char
*
)
image
->
obdata
);
}
free
((
char
*
)
image
->
obdata
);
free
((
char
*
)
image
);
*
pImage
=
newImage
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
View file @
ce182e88
...
...
@@ -1172,10 +1172,7 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
XDestroyImage
(
image
);
}
if
(
data
!=
NULL
)
{
free
(
data
);
}
free
(
data
);
}
else
{
...
...
@@ -1421,10 +1418,7 @@ FIXME: If the pixmap has a different depth from the window, the
fprintf
(
stderr
,
"nxagentPixmapOnShadowDisplay: XCreateImage failed.
\n
"
);
#endif
if
(
data
!=
NULL
)
{
free
(
data
);
}
free
(
data
);
return
False
;
}
...
...
@@ -1583,10 +1577,7 @@ Bool nxagentFbOnShadowDisplay()
fprintf
(
stderr
,
"nxagentFbOnShadowDisplay: XCreateImage failed.
\n
"
);
#endif
if
(
data
)
{
free
(
data
);
}
free
(
data
);
return
False
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
ce182e88
...
...
@@ -610,12 +610,8 @@ Bool nxagentReconnectSession(void)
nxagentXkbState
.
Initialized
=
0
;
if
(
nxagentOldKeyboard
!=
NULL
)
{
free
(
nxagentOldKeyboard
);
nxagentOldKeyboard
=
NULL
;
}
free
(
nxagentOldKeyboard
);
nxagentOldKeyboard
=
NULL
;
nxagentInitPointerMap
();
...
...
@@ -739,12 +735,8 @@ nxagentReconnectError:
nxagentDisconnectDisplay
();
}
if
(
nxagentOldKeyboard
!=
NULL
)
{
free
(
nxagentOldKeyboard
);
nxagentOldKeyboard
=
NULL
;
}
free
(
nxagentOldKeyboard
);
nxagentOldKeyboard
=
NULL
;
return
0
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
ce182e88
...
...
@@ -3079,10 +3079,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
length
=
nxagentImageLength
(
width
,
height
,
ZPixmap
,
0
,
nxagentMasterDepth
);
if
(
tBuffer
)
{
free
(
tBuffer
);
}
free
(
tBuffer
);
tBuffer
=
malloc
(
length
);
...
...
@@ -3139,10 +3136,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
RegionUnion
(
&
nxagentShadowUpdateRegion
,
&
nxagentShadowUpdateRegion
,
&
updateRegion
);
}
if
(
tBuffer
)
{
free
(
tBuffer
);
}
free
(
tBuffer
);
RegionUninit
(
&
updateRegion
);
}
...
...
@@ -3360,10 +3354,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
cBuffer
=
(
unsigned
char
*
)
*
buffer
;
*
buffer
=
(
char
*
)
icBuffer
;
if
(
cBuffer
!=
NULL
)
{
free
(
cBuffer
);
}
free
(
cBuffer
);
}
#ifdef NXAGENT_ARTSD
...
...
@@ -3826,9 +3817,8 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
#endif
number
=
1
;
if
(
screeninfo
)
{
free
(
screeninfo
);
}
free
(
screeninfo
);
if
(
!
(
screeninfo
=
malloc
(
sizeof
(
XineramaScreenInfo
))))
{
return
FALSE
;
}
...
...
@@ -4111,10 +4101,8 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
}
/* release allocated memory */
if
(
screeninfo
)
{
free
(
screeninfo
);
screeninfo
=
NULL
;
}
free
(
screeninfo
);
screeninfo
=
NULL
;
#ifdef DEBUG
for
(
i
=
0
;
i
<
pScrPriv
->
numCrtcs
;
i
++
)
{
...
...
@@ -4587,10 +4575,7 @@ FIXME
fprintf
(
stderr
,
"nxagentShowPixmap: XGetImage failed.
\n
"
);
#endif
if
(
data
)
{
free
(
data
);
}
free
(
data
);
return
;
}
...
...
@@ -4623,10 +4608,7 @@ FIXME
XDestroyImage
(
image
);
}
if
(
data
!=
NULL
)
{
free
(
data
);
}
free
(
data
);
/*
FIXME
...
...
@@ -4678,10 +4660,7 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc,
fprintf
(
stderr
,
"nxagentFbRestoreArea: XGetImage failed.
\n
"
);
#endif
if
(
data
)
{
free
(
data
);
}
free
(
data
);
return
;
}
...
...
@@ -4741,10 +4720,7 @@ FIXME
/*
FIXME
if (data)
{
free(data);
}
free(data);
*/
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
ce182e88
...
...
@@ -3151,12 +3151,7 @@ FIXME: Do we need to set save unders attribute here?
&
hints
);
#ifdef _XSERVER64
if
(
data64
!=
NULL
)
{
free
(
data64
);
}
free
(
data64
);
#endif
}
}
...
...
@@ -3404,10 +3399,7 @@ Bool nxagentCheckWindowIntegrity(WindowPtr pWin)
XDestroyImage
(
image
);
}
if
(
data
)
{
free
(
data
);
}
free
(
data
);
}
else
{
...
...
@@ -3947,11 +3939,8 @@ int nxagentEmptyBSPixmapList()
for
(
i
=
0
;
i
<
BSPIXMAPLIMIT
;
i
++
)
{
if
(
nxagentBSPixmapList
[
i
]
!=
NULL
)
{
free
(
nxagentBSPixmapList
[
i
]);
nxagentBSPixmapList
[
i
]
=
NULL
;
}
free
(
nxagentBSPixmapList
[
i
]);
nxagentBSPixmapList
[
i
]
=
NULL
;
}
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