commit: 99da73eab988dcfb6b85b3828087657fe80dfa7c
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 19 16:05:49 2025 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Dec 19 16:05:49 2025 +0000
URL: https://gitweb.gentoo.org/proj/steve.git/commit/?id=99da73ea
Free fuse_buf
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
steve.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/steve.cxx b/steve.cxx
index 5eaf676..b7a7b11 100644
--- a/steve.cxx
+++ b/steve.cxx
@@ -116,10 +116,8 @@ struct steve_state {
struct timeval recheck_timeout{0, 500000};
bool recheck_triggered{false};
event_ptr recheck_event{nullptr, event_free};
-
- /* to workaround lack of fuse_buf_free(), keep a global buffer */
- /* https://github.com/libfuse/libfuse/issues/1373 */
struct fuse_session *session;
+ /* keep a global buffer as an optimization */
struct fuse_buf buf{};
};
@@ -392,6 +390,8 @@ static void steve_destroy(void *userdata)
state->processes.clear();
if (state->loadavg_fd >= 0)
close(state->loadavg_fd);
+ if (state->buf.mem)
+ free(state->buf.mem);
}
static void steve_open(fuse_req_t req, struct fuse_file_info *fi)