aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-07-22 21:53:20 +0200
committerUlrich Sibiller <uli42@gmx.de>2019-08-06 21:57:32 +0200
commitdde4e7636bb48360696b1886978c7c4626dd40f3 (patch)
treef34a561a7cc4ec3e26722ba41e79562d056b9193
parent458538010837633483409700f42a81d4650f2169 (diff)
downloadnx-libs-dde4e7636bb48360696b1886978c7c4626dd40f3.tar.gz
nx-libs-dde4e7636bb48360696b1886978c7c4626dd40f3.tar.bz2
nx-libs-dde4e7636bb48360696b1886978c7c4626dd40f3.zip
Image.c: use SAFE_free
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Image.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c
index a5e19724b..a7bacaf85 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Image.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c
@@ -455,7 +455,7 @@ FIXME: Here the split trap is always set and so the caching of
if (nxagentUnpackAlpha[resource] != NULL)
{
- free(nxagentUnpackAlpha[resource] -> data);
+ SAFE_free(nxagentUnpackAlpha[resource] -> data);
}
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
fprintf(stderr, "nxagentSetUnpackAlpha: PANIC! Can't allocate data for the alpha structure.\n");
#endif
- free(data);
+ SAFE_free(data);
return;
}
@@ -483,7 +483,7 @@ FIXME: Here the split trap is always set and so the caching of
resource, size);
#endif
- free(data);
+ SAFE_free(data);
}
}
@@ -1567,20 +1567,20 @@ nxagentPutSubImageEnd:
nxagentImageStatistics.totalEncoded, nxagentImageStatistics.totalAdded);
#endif
- free(packedChecksum);
+ SAFE_free(packedChecksum);
if (packedImage != NULL)
{
if (packedImage -> data != NULL &&
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,
@@ -1634,11 +1634,8 @@ void nxagentResetAlphaCache(void)
{
if (nxagentUnpackAlpha[i])
{
- free(nxagentUnpackAlpha[i] -> data);
-
- free(nxagentUnpackAlpha[i]);
-
- nxagentUnpackAlpha[i] = NULL;
+ SAFE_free(nxagentUnpackAlpha[i] -> data);
+ SAFE_free(nxagentUnpackAlpha[i]);
}
}
}
@@ -1716,7 +1713,7 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
if (newImage -> data == NULL)
{
- free(newImage);
+ SAFE_free(newImage);
#ifdef PANIC
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,
}
}
- free((char *) image -> obdata);
- free((char *) image);
+ SAFE_free(image -> obdata);
+ SAFE_free(image);
*pImage = newImage;