From cbe764c42b7f39e833c70f2f00b704aef76aa1fb Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Mon, 12 May 2014 13:10:04 +0200 Subject: Fix missing closedir() in Find_File::Find_Internal() Change-Id: Ie74570d3203be347390ca74bd00429bde87d6741 Signed-off-by: Vojtech Bocek --- find_file.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'find_file.cpp') diff --git a/find_file.cpp b/find_file.cpp index f56f243de..8ae0a51b4 100644 --- a/find_file.cpp +++ b/find_file.cpp @@ -33,7 +33,7 @@ Find_File::Find_File() { } string Find_File::Find_Internal(const string& filename, const string& starting_path) { - DIR *d = opendir(starting_path.c_str()); + DIR *d; string new_path, return_path; vector dirs; vector symlinks; @@ -45,6 +45,7 @@ string Find_File::Find_Internal(const string& filename, const string& starting_p } searched_dirs.push_back(starting_path); + d = opendir(starting_path.c_str()); if (d == NULL) { LOGERR("Find_File: Error opening '%s'\n", starting_path.c_str()); return ""; -- cgit v1.2.3