fix trivial memory leak

This commit is contained in:
Valient Gough 2016-04-26 22:55:56 -07:00
parent 19a49b7865
commit 057a5741e7
No known key found for this signature in database
GPG Key ID: B515DCEB95967051

View File

@ -165,8 +165,8 @@ static int showInfo(int argc, char **argv) {
string rootDir = argv[1];
if (!checkDir(rootDir)) return EXIT_FAILURE;
EncFSConfig *config = new EncFSConfig;
ConfigType type = readConfig(rootDir, config);
std::shared_ptr<EncFSConfig> config(new EncFSConfig);
ConfigType type = readConfig(rootDir, config.get());
// show information stored in config..
switch (type) {
@ -210,8 +210,7 @@ static int showInfo(int argc, char **argv) {
break;
}
showFSInfo(config);
delete config;
showFSInfo(config.get());
return EXIT_SUCCESS;
}