From 7e975e3ccff9aa809c1fec7b2642615f2a934c10 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 18 Nov 2017 23:33:53 +0100 Subject: simply free() calls free() can handle NULL so there's no need to check this ourselves --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 28 ++++++++------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Drawable.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 917f460ba..c3d27073e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -264,7 +264,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask success = 0; - goto nxagentSynchronizeDrawableDataFree; + goto nxagentSynchronizeDrawableDataEnd; } ValidateGC(pDrawable, pGC); @@ -282,7 +282,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask success = 1; - goto nxagentSynchronizeDrawableDataFree; + goto nxagentSynchronizeDrawableDataEnd; } else if (nxagentReconnectTrap == 1) { @@ -323,7 +323,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask success = 0; - goto nxagentSynchronizeDrawableDataFree; + goto nxagentSynchronizeDrawableDataEnd; } ValidateGC(pDrawable, pGC); @@ -336,7 +336,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask success = 1; - goto nxagentSynchronizeDrawableDataFree; + goto nxagentSynchronizeDrawableDataEnd; } else { @@ -349,7 +349,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask success = 1; - goto nxagentSynchronizeDrawableDataFree; + goto nxagentSynchronizeDrawableDataEnd; } } } @@ -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); -- cgit v1.2.3