From bcb41cd938ae864aee11b29ba90cd9d71bcbe8e6 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Mon, 23 Dec 2013 10:02:48 -0800 Subject: [PATCH] fix(util/lean_path): warnings produced by Valgrind Signed-off-by: Leonardo de Moura --- src/util/lean_path.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/lean_path.cpp b/src/util/lean_path.cpp index ce16be861..9ae78c3fe 100644 --- a/src/util/lean_path.cpp +++ b/src/util/lean_path.cpp @@ -43,6 +43,7 @@ static std::string get_exe_location() { // Linux version #include #include +#include #include #include // NOLINT #include @@ -52,6 +53,7 @@ static char g_bad_sep = '\\'; static std::string get_exe_location() { char path[PATH_MAX]; char dest[PATH_MAX]; + memset(dest, 0, PATH_MAX); pid_t pid = getpid(); snprintf(path, PATH_MAX, "/proc/%d/exe", pid); if (readlink(path, dest, PATH_MAX) == -1) {