mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
include: regionstr.h: protect RegionUninit() from free()ing on .data
There might be a chance that RegionUninit() is trying to free() some struct that's actually coming from .data segment. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -163,7 +163,8 @@ static inline void
|
||||
RegionUninit(RegionPtr _pReg)
|
||||
{
|
||||
if ((_pReg)->data && (_pReg)->data->size) {
|
||||
free((_pReg)->data);
|
||||
if ((_pReg)->data != &RegionEmptyData)
|
||||
free((_pReg)->data);
|
||||
(_pReg)->data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user