aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2013-02-07 14:59:28 +0100
committerMiklos Szeredi <mszeredi@suse.cz>2013-02-07 14:59:28 +0100
commit1bea285a3a586c97597b1f690f14051ff63f3f0b (patch)
treecee75e141538bbdb7cd74557c14b26d1cfb8f69b
parent74f9acbd18c55708698831b4cfb980c262ee91ee (diff)
downloadlibfuse-1bea285a3a586c97597b1f690f14051ff63f3f0b.tar.gz
libfuse-fix-fs-cleanup
This fixes a segmentation fault if command-line option parsing fails during initialization. Reported by Eric Wong
-rw-r--r--ChangeLog2
-rw-r--r--lib/fuse.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 83438b1..eeb4db6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
* libfuse: add poll_events to fuse_file_info. Patch by Enke Chen
+ * libfuse: fix fs cleanup. Reported by Eric Wong
+
2013-02-06 Miklos Szeredi <miklos@szeredi.hu>
* libfuse: set close-on-exec flag on pipe file descriptors. Patch
diff --git a/lib/fuse.c b/lib/fuse.c
index 401a263..fc10135 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -4584,10 +4584,9 @@ out_free_name_table:
out_free_session:
fuse_session_destroy(f->se);
out_free_fs:
- /* Horrible compatibility hack to stop the destructor from being
- called on the filesystem without init being called first */
- fs->op.destroy = NULL;
- fuse_fs_destroy(f->fs);
+ if (f->fs->m)
+ fuse_put_module(f->fs->m);
+ free(f->fs);
free(f->conf.modules);
out_free:
free(f);