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:
parent
2b9ccde53a
commit
8b079ed198
|
@ -163,7 +163,8 @@ static inline void
|
||||||
RegionUninit(RegionPtr _pReg)
|
RegionUninit(RegionPtr _pReg)
|
||||||
{
|
{
|
||||||
if ((_pReg)->data && (_pReg)->data->size) {
|
if ((_pReg)->data && (_pReg)->data->size) {
|
||||||
free((_pReg)->data);
|
if ((_pReg)->data != &RegionEmptyData)
|
||||||
|
free((_pReg)->data);
|
||||||
(_pReg)->data = NULL;
|
(_pReg)->data = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue