diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h index 9ef95c1fbe..e6c89e40cd 100644 --- a/src/corelib/xml/qxmlstream_p.h +++ b/src/corelib/xml/qxmlstream_p.h @@ -651,7 +651,8 @@ public: inline void reserve(int extraCapacity) { if (tos + extraCapacity + 1 > cap) { cap = qMax(tos + extraCapacity + 1, cap << 1 ); - data = reinterpret_cast(realloc(data, cap * sizeof(T))); + void *ptr = realloc(static_cast(data), cap * sizeof(T)); + data = reinterpret_cast(ptr); Q_CHECK_PTR(data); } }