Skip to content
Permalink
Browse files

fix mem error for config global `homeDir`

Fix `homeDir` `ConfigManager` global pointing to freed memory.

Thanks to @FredericHamel for catching this.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information
rkitover committed Jun 23, 2019
1 parent ccc91fa commit 684b1bb7aaa220b8f00b46612846fb04c0f5fe89
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/common/ConfigManager.cpp
@@ -663,7 +663,7 @@ const char* FindConfigFile(const char *name)

struct stat s;
std::string homeDirTmp = get_xdg_user_config_home() + DOT_DIR;
homeDir = (char *)homeDirTmp.c_str();
homeDir = strdup(homeDirTmp.c_str());
if (stat(homeDir, &s) == -1 || !S_ISDIR(s.st_mode))
mkdir(homeDir, 0755);

0 comments on commit 684b1bb

Please sign in to comment.
You can’t perform that action at this time.