fix(fuse): fix fd leak in extract_mount_point
Some checks failed
Build / build (push) Has been cancelled

This commit is contained in:
SF-Zhou 2025-06-17 17:20:51 +08:00 committed by GitHub
parent 91bfcf3606
commit 2db69ced80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,7 @@
#include <fcntl.h>
#include <fmt/format.h>
#include <folly/logging/xlog.h>
#include <folly/ScopeGuard.h>
#include <iostream>
#include <numa.h>
#include <sys/stat.h>
@ -49,6 +50,7 @@ int hf3fs_extract_mount_point(char *hf3fs_mount_point, int size, const char *pat
auto fp = fopen("/proc/self/mountinfo", "r");
XLOGF_IF(FATAL, !fp, "cannot read system mount info");
SCOPE_EXIT { fclose(fp); };
char line[4096];
std::vector<std::string> parts;