QRegion: fix a memory leak
An early return in case of errors leaked memory tracked in a variable in scope. Change-Id: I68cd77890608caff54df7476d38850e5541ce76e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This commit is contained in:
parent
772b799a83
commit
d9e1a0f05b
@ -3562,8 +3562,10 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule)
|
||||
return region;
|
||||
}
|
||||
|
||||
if (!(pETEs = static_cast<EdgeTableEntry *>(malloc(sizeof(EdgeTableEntry) * Count))))
|
||||
if (!(pETEs = static_cast<EdgeTableEntry *>(malloc(sizeof(EdgeTableEntry) * Count)))) {
|
||||
delete region;
|
||||
return 0;
|
||||
}
|
||||
|
||||
region->vectorize();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user