libfuse-fix-fs-cleanup
authorMiklos Szeredi <mszeredi@suse.cz>
Thu, 7 Feb 2013 13:59:28 +0000 (14:59 +0100)
committerMiklos Szeredi <mszeredi@suse.cz>
Thu, 7 Feb 2013 13:59:28 +0000 (14:59 +0100)
This fixes a segmentation fault if command-line option parsing fails during
initialization.

Reported by Eric Wong

ChangeLog
lib/fuse.c

index 83438b13984b274569025944caf59a8004ea8370..eeb4db6433fc036cc18865b83a4c62d6d6197739 100644 (file)
--- 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
index 401a263defed4e179956ddf39e84edf56ec9b673..fc1013515c2a9aa78a8c4369c35742244d21e97d 100644 (file)
@@ -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);