Skip to content

Commit cbe764c

Browse files
TasssadarGerrit Code Review
authored andcommitted
Fix missing closedir() in Find_File::Find_Internal()
Change-Id: Ie74570d3203be347390ca74bd00429bde87d6741 Signed-off-by: Vojtech Bocek <[email protected]>
1 parent 277f742 commit cbe764c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

find_file.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Find_File::Find_File() {
3333
}
3434

3535
string Find_File::Find_Internal(const string& filename, const string& starting_path) {
36-
DIR *d = opendir(starting_path.c_str());
36+
DIR *d;
3737
string new_path, return_path;
3838
vector<string> dirs;
3939
vector<string> symlinks;
@@ -45,6 +45,7 @@ string Find_File::Find_Internal(const string& filename, const string& starting_p
4545
}
4646
searched_dirs.push_back(starting_path);
4747

48+
d = opendir(starting_path.c_str());
4849
if (d == NULL) {
4950
LOGERR("Find_File: Error opening '%s'\n", starting_path.c_str());
5051
return "";

0 commit comments

Comments
 (0)