summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydatapointer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qarraydatapointer.h')
-rw-r--r--src/corelib/tools/qarraydatapointer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index 466cdecfc7d..eb6ceeafeef 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -320,10 +320,12 @@ public:
const qsizetype n = std::distance(first, last);
if (needsDetach() || n > constAllocatedCapacity()) {
QArrayDataPointer allocated(Data::allocate(detachCapacity(n)));
+ Q_CHECK_PTR(allocated.data());
swap(allocated);
}
} else if (needsDetach()) {
QArrayDataPointer allocated(Data::allocate(allocatedCapacity()));
+ Q_CHECK_PTR(allocated.data());
swap(allocated);
// We don't want to copy data that we know we'll overwrite
}