From 2489000d3fd66319a8355fd4e37cfdfda47296d0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 31 Jan 2017 14:46:38 +0200 Subject: loplugin:useuniqueptr extend to check local vars just the simple and obvious case for now, of a local var being allocated and deleted inside a single local block, and the delete happening at the end of the block Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625 Reviewed-on: https://gerrit.libreoffice.org/33749 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sccomp/source/solver/LpsolveSolver.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sccomp') diff --git a/sccomp/source/solver/LpsolveSolver.cxx b/sccomp/source/solver/LpsolveSolver.cxx index d517696c8577..114a259dc304 100644 --- a/sccomp/source/solver/LpsolveSolver.cxx +++ b/sccomp/source/solver/LpsolveSolver.cxx @@ -218,7 +218,7 @@ void SAL_CALL LpsolveSolver::solve() table::CellAddress aLeftAddr = maConstraints[nConstrPos].Left; const std::vector& rLeftCoeff = aCellsHash[aLeftAddr]; - REAL* pValues = new REAL[nVariables+1]; + std::unique_ptr pValues(new REAL[nVariables+1] ); pValues[0] = 0.0; // ignored? for (nVar=0; nVar