From 1bea285a3a586c97597b1f690f14051ff63f3f0b Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 7 Feb 2013 14:59:28 +0100 Subject: libfuse-fix-fs-cleanup This fixes a segmentation fault if command-line option parsing fails during initialization. Reported by Eric Wong --- lib/fuse.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/fuse.c') 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); -- cgit v1.2.3