Commit b4e9a82c authored by Tommi Rantala's avatar Tommi Rantala

Call closedir() in list_dir()

Valgrind was complaining:

==8428== 32,816 bytes in 1 blocks are definitely lost in loss record 983 of 985
==8428==    at 0x4C2EDA7: malloc (vg_replace_malloc.c:299)
==8428==    by 0x96779A5: __alloc_dir (in /usr/lib64/libc-2.27.so)
==8428==    by 0x9677AAC: opendir_tail (in /usr/lib64/libc-2.27.so)
==8428==    by 0x59EC50: bpftrace::list_dir(...)
==8428==    by 0x59ED5F: bpftrace::list_probes(...)
==8428==    by 0x594993: main
parent c4e8dd12
......@@ -61,6 +61,8 @@ void list_dir(const std::string path, std::vector<std::string> &files)
while ((dep = readdir(dp)) != NULL)
files.push_back(std::string(dep->d_name));
closedir(dp);
}
void list_probes(const std::string &search)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment