diff --git a/src/conky.cc b/src/conky.cc index 46de6502..a625442f 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -4163,12 +4163,11 @@ void set_current_config() { FILE *fp; /* Try to use personal config file first */ - std::string *buf = new std::string(to_real_path(CONFIG_FILE)); - if (!buf->empty() && (fp = fopen(buf->c_str(), "r"))) { - current_config = buf->c_str(); + std::string buf = to_real_path(CONFIG_FILE); + if (!buf.empty() && (fp = fopen(buf.c_str(), "r"))) { + current_config = buf; fclose(fp); } - delete buf; /* Try to use system config file if personal config not readable */ if (current_config.empty() && (fp = fopen(SYSTEM_CONFIG_FILE, "r"))) {