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.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index f2cd3ec983..aef38bc20b 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -169,8 +169,10 @@ public:
private:
Data *clone(QArrayData::AllocationOptions options) const Q_REQUIRED_RESULT
{
- QArrayDataPointer copy(Data::allocate(d->detachCapacity(d->size),
- options));
+ Data *x = Data::allocate(d->detachCapacity(d->size), options);
+ Q_CHECK_PTR(x);
+ QArrayDataPointer copy(x);
+
if (d->size)
copy->copyAppend(d->begin(), d->end());