Don't dereference pointers on QArrayData deallocation
If the allocation fails the pointer will be 0. That is OK for free(), but we shouldn't try to check for static data then. Change-Id: I0a8860c9e04833e3be79f7a8a39bdaffeb488f35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>bb10
parent
9d44645eae
commit
9eb2b25300
|
|
@ -118,7 +118,8 @@ void QArrayData::deallocate(QArrayData *data, size_t objectSize,
|
|||
return;
|
||||
#endif
|
||||
|
||||
Q_ASSERT_X(!data->ref.isStatic(), "QArrayData::deallocate", "Static data can not be deleted");
|
||||
Q_ASSERT_X(data == 0 || !data->ref.isStatic(), "QArrayData::deallocate",
|
||||
"Static data can not be deleted");
|
||||
::free(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue