Commit 6378d5ad authored by Ulrich Sibiller's avatar Ulrich Sibiller

GC.c: use SAFE_free

parent a9819436
...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment