From 6a4a61d9e1017190f122219681c239b82cfe9390 Mon Sep 17 00:00:00 2001 From: Matthias Maennich Date: Mon, 9 Oct 2017 16:26:31 +0200 Subject: cmForEachCommand: prevent leakage --- Source/cmForEachCommand.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 542a860..df288bd 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -7,6 +7,7 @@ #include #include +#include "cmAlgorithms.h" #include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmSystemTools.h" @@ -121,7 +122,7 @@ bool cmForEachCommand::InitialPass(std::vector const& args, } // create a function blocker - cmForEachFunctionBlocker* f = new cmForEachFunctionBlocker(this->Makefile); + auto f = cm::make_unique(this->Makefile); if (args.size() > 1) { if (args[1] == "RANGE") { int start = 0; @@ -175,7 +176,7 @@ bool cmForEachCommand::InitialPass(std::vector const& args, } else { f->Args = args; } - this->Makefile->AddFunctionBlocker(f); + this->Makefile->AddFunctionBlocker(f.release()); return true; } -- cgit v0.12