aboutsummaryrefslogtreecommitdiff
path: root/lib/fuse_loop_mt.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fuse_loop_mt.c')
-rw-r--r--lib/fuse_loop_mt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c
index 478aae7..c0828f7 100644
--- a/lib/fuse_loop_mt.c
+++ b/lib/fuse_loop_mt.c
@@ -68,6 +68,7 @@ static void *do_work(void *data)
return NULL;
}
+ pthread_cleanup_push(free, buf);
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
@@ -99,6 +100,7 @@ static void *do_work(void *data)
pthread_mutex_unlock(&w->lock);
fuse_session_process(w->se, buf, res, w->ch);
}
+ pthread_cleanup_pop(1);
/* Wait for cancellation */
if (!is_mainthread)