aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/GC.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-08-27 08:27:42 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-08-27 08:27:42 +0200
commit6f80a06fb96725e7eadf846bf0e727821aadbf47 (patch)
tree64846b3be22e28618ffe285db02d55fa5d4de709 /nx-X11/programs/Xserver/hw/nxagent/GC.c
parent8b15d574b49857cdf4df0fd813d68b750d8aee5f (diff)
parentf39b81d31bc7d0427ea9cca04d0e4a21579d7383 (diff)
downloadnx-libs-6f80a06fb96725e7eadf846bf0e727821aadbf47.tar.gz
nx-libs-6f80a06fb96725e7eadf846bf0e727821aadbf47.tar.bz2
nx-libs-6f80a06fb96725e7eadf846bf0e727821aadbf47.zip
Merge branch 'uli42-pr/safe_free' into 3.6.x
Attributes GH PR #826: https://github.com/ArcticaProject/nx-libs/pull/826
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/GC.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GC.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c
index 2fac2f100..df9c4ad0a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/GC.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c
@@ -61,6 +61,7 @@ is" without express or implied warranty.
#include "Trap.h"
#include "Screen.h"
#include "Pixels.h"
+#include "Utils.h"
#include "../../fb/fb.h"
@@ -694,7 +695,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y,
pRects, nRects, Unsorted);
- free((char *) pRects);
+ SAFE_free(pRects);
}
break;
@@ -778,7 +779,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
pGC->clientClip = (void *) RegionFromRects(nRects,
(xRectangle *)pValue, type);
- free(pValue);
+ SAFE_free(pValue);
pValue = pGC->clientClip;
@@ -912,9 +913,8 @@ static void nxagentFreeGCRec(struct nxagentGCRec *t)
(void *) t, (void *) t -> gc);
#endif
- free(t -> gc);
-
- free(t);
+ SAFE_free(t -> gc);
+ SAFE_free(t);
}
static void nxagentRestoreGCRec(struct nxagentGCRec *t)
@@ -924,11 +924,11 @@ static void nxagentRestoreGCRec(struct nxagentGCRec *t)
(void*)t, (void*)t -> gc);
#endif
- free(nxagentGC(t -> pGC));
+ SAFE_free(nxagentGC(t -> pGC));
nxagentGC(t -> pGC) = t -> gc;
- free(t);
+ SAFE_free(t);
}
static void nxagentAddGCToList(GCPtr pGC)
@@ -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,
pRects, nRects, Unsorted);
- free((char *) pRects);
+ SAFE_free(pRects);
}
else
{
@@ -1374,7 +1374,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
pGC->clientClip = (void *) RegionFromRects(nRects,
(xRectangle *)pValue, type);
- free(pValue);
+ SAFE_free(pValue);
pValue = pGC->clientClip;
type = CT_REGION;