From 5d5862170528a22a13d1ce7becd302579dc376e0 Mon Sep 17 00:00:00 2001 From: Tor Brede Vekterli Date: Tue, 7 Apr 2020 10:03:12 +0000 Subject: Use std::string instead of un-free()d strdup --- configd/src/apps/sentinel/sentinel.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'configd/src/apps') 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 -#include -#include #include #include #include -#include "config-handler.h" +#include +#include +#include +#include #include 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) { -- cgit v1.2.3