diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-03 21:49:05 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-03 22:02:42 +0100 |
commit | 163dd5df9f080a141e201a32c40ff80e1a5d2e34 (patch) | |
tree | b570c8922a498848e64e66ff14d205f5f474a064 /chart2 | |
parent | d85108355c1802c7aed1ef1d9a19f6c633c4a0f8 (diff) |
tdf#120703 PVS: V1023
V1023 A pointer without owner is added to the 'm_aChartTypeDialogControllerList'
container by the 'emplace_back' method. A memory leak will occur in case
of an exception.
Change-Id: I35bf344fd083c6a1717a150f78370ec59f206240
Reviewed-on: https://gerrit.libreoffice.org/62821
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/dialogs/tp_ChartType.cxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 75f8a76ff5f8..e80e2303e433 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -28,6 +28,7 @@ #include <svtools/controldims.hxx> +#include <o3tl/make_unique.hxx> #include <vcl/weld.hxx> #include <tools/diagnose_ex.h> #include <sal/log.hxx> @@ -654,22 +655,24 @@ ChartTypeTabPage::ChartTypeTabPage(TabPageParent pParent , const uno::Reference< } } - m_aChartTypeDialogControllerList.emplace_back(new ColumnChartDialogController() ); - m_aChartTypeDialogControllerList.emplace_back(new BarChartDialogController() ); - m_aChartTypeDialogControllerList.emplace_back(new PieChartDialogController() ); - m_aChartTypeDialogControllerList.emplace_back(new AreaChartDialogController() ); - m_aChartTypeDialogControllerList.emplace_back(new LineChartDialogController() ); + m_aChartTypeDialogControllerList.push_back(o3tl::make_unique<ColumnChartDialogController>()); + m_aChartTypeDialogControllerList.push_back(o3tl::make_unique<BarChartDialogController>()); + m_aChartTypeDialogControllerList.push_back(o3tl::make_unique<PieChartDialogController>()); + m_aChartTypeDialogControllerList.push_back(o3tl::make_unique<AreaChartDialogController>()); + m_aChartTypeDialogControllerList.push_back(o3tl::make_unique<LineChartDialogController>()); if (bEnableComplexChartTypes) { - m_aChartTypeDialogControllerList.emplace_back(new XYChartDialogController() ); - m_aChartTypeDialogControllerList.emplace_back(new BubbleChartDialogController() ); + m_aChartTypeDialogControllerList.push_back(o3tl::make_unique<XYChartDialogController>()); + m_aChartTypeDialogControllerList.push_back( + o3tl::make_unique<BubbleChartDialogController>()); } - m_aChartTypeDialogControllerList.emplace_back(new NetChartDialogController() ); + m_aChartTypeDialogControllerList.push_back(o3tl::make_unique<NetChartDialogController>()); if (bEnableComplexChartTypes) { - m_aChartTypeDialogControllerList.emplace_back(new StockChartDialogController() ); + m_aChartTypeDialogControllerList.push_back(o3tl::make_unique<StockChartDialogController>()); } - m_aChartTypeDialogControllerList.emplace_back(new CombiColumnLineChartDialogController() ); + m_aChartTypeDialogControllerList.push_back( + o3tl::make_unique<CombiColumnLineChartDialogController>()); for (auto const& elem : m_aChartTypeDialogControllerList) { |