summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@leguin.anholt.net>2006-04-05 16:38:52 -0700
committerJamey Sharp <jamey@minilop.net>2006-06-06 11:23:14 -0700
commit6d06e41d1f431b3f1a1fcf69161e0af411325e9f (patch)
treeacb65aeba200578019a621e5881037b273d1e96e
parent5fd8f79ad3e38df74d9a6cb573617542c101df1a (diff)
downloadxorg-lib-libX11-6d06e41d1f431b3f1a1fcf69161e0af411325e9f.tar.gz
Coverity #582: Free newly-allocated region in error path.
-rw-r--r--src/PolyReg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/PolyReg.c b/src/PolyReg.c
index 4b17ec5c..68afeaf0 100644
--- a/src/PolyReg.c
+++ b/src/PolyReg.c
@@ -524,8 +524,10 @@ XPolygonRegion(Pts, Count, rule)
if (Count < 2) return region;
if (! (pETEs = (EdgeTableEntry *)
- Xmalloc((unsigned) (sizeof(EdgeTableEntry) * Count))))
+ Xmalloc((unsigned) (sizeof(EdgeTableEntry) * Count)))) {
+ XDestroyRegion(region);
return (Region) NULL;
+ }
pts = FirstPtBlock.pts;
CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock);