From 3709c008914a221728cd40af0759773682cae084 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 26 Jun 2019 13:30:01 +0000 Subject: [PATCH] use QList::detach_helper in QList::reserve() to avoid leak Signed-off-by: Ivailo Monev --- src/core/tools/qlist.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/tools/qlist.h b/src/core/tools/qlist.h index a5a2f3028..b924c52ec 100644 --- a/src/core/tools/qlist.h +++ b/src/core/tools/qlist.h @@ -451,10 +451,7 @@ template Q_OUTOFLINE_TEMPLATE void QList::reserve(int alloc) { if (d->alloc < alloc) { - if (d->ref != 1) - detach_helper(alloc); - else - p.reallocData(alloc); + detach_helper(alloc); } } -- 2.11.0