summaryrefslogtreecommitdiffstats
path: root/configd
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2020-04-07 10:03:12 +0000
committerTor Brede Vekterli <vekterli@verizonmedia.com>2020-04-07 10:03:12 +0000
commit5d5862170528a22a13d1ce7becd302579dc376e0 (patch)
tree320248673ce945dc62ca271152e4afba40275759 /configd
parentc7f2e56fdb745c2c0c61e2f59f9c45ee873531be (diff)
Use std::string instead of un-free()d strdup
Diffstat (limited to 'configd')
-rw-r--r--configd/src/apps/sentinel/sentinel.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/configd/src/apps/sentinel/sentinel.cpp b/configd/src/apps/sentinel/sentinel.cpp
index b062d7526b6..9f179e96393 100644
--- a/configd/src/apps/sentinel/sentinel.cpp
+++ b/configd/src/apps/sentinel/sentinel.cpp
@@ -1,12 +1,14 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include "config-handler.h"
#include <vespa/config/common/exceptions.h>
-#include <unistd.h>
-#include <sys/time.h>
#include <vespa/vespalib/util/signalhandler.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/defaults.h>
-#include "config-handler.h"
+#include <chrono>
+#include <string>
+#include <unistd.h>
+#include <sys/time.h>
#include <vespa/log/log.h>
LOG_SETUP("config-sentinel");
@@ -31,7 +33,7 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
- const char *configId = strdup(optarg);
+ std::string configId(optarg);
const char *rootDir = getenv("ROOT");
if (!rootDir) {