Commit be79f26c authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

upmpdcli would crash if -c was not set and the default config was not found....

upmpdcli would crash if -c was not set and the default config was not found. Fix by creating an empty config
parent 2bc6da85
......@@ -161,7 +161,7 @@ static UpnpDevice *dev;
string g_datadir(DATADIR "/");
// Global
string g_configfilename(CONFIGDIR "/upmpdcli.conf");
string g_configfilename;
std::mutex g_configlock;
ConfSimple *g_config;
......@@ -407,6 +407,13 @@ int main(int argc, char *argv[])
break;
}
}
} else {
// g_configfilename is empty. Create an empty config anyway
g_config = new ConfSimple(string(), 1, true);
if (!g_config || !g_config->ok()) {
cerr << "Could not create empty config\n";
return 1;
}
}
if (Logger::getTheLog(logfilename) == 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment