summaryrefslogtreecommitdiff
path: root/Source/cmForEachCommand.cxx
diff options
context:
space:
mode:
authorMatthias Maennich <matthias@maennich.net>2017-10-09 16:26:31 +0200
committerBrad King <brad.king@kitware.com>2017-10-30 09:55:02 -0400
commit6a4a61d9e1017190f122219681c239b82cfe9390 (patch)
tree408a17789ca0e7440ac55fc0bb0c2226350b99b0 /Source/cmForEachCommand.cxx
parent52680d8092bf3c32e3fa27460b22434d58095f27 (diff)
downloadcmake-6a4a61d9e1017190f122219681c239b82cfe9390.tar.gz
cmForEachCommand: prevent leakage
Diffstat (limited to 'Source/cmForEachCommand.cxx')
-rw-r--r--Source/cmForEachCommand.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 542a860258..df288bd682 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
@@ -121,7 +122,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
}
// create a function blocker
- cmForEachFunctionBlocker* f = new cmForEachFunctionBlocker(this->Makefile);
+ auto f = cm::make_unique<cmForEachFunctionBlocker>(this->Makefile);
if (args.size() > 1) {
if (args[1] == "RANGE") {
int start = 0;
@@ -175,7 +176,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
} else {
f->Args = args;
}
- this->Makefile->AddFunctionBlocker(f);
+ this->Makefile->AddFunctionBlocker(f.release());
return true;
}