Fix a potential null pointer dereference issue
authorLaszlo Papp <ext-laszlo.papp@nokia.com>
Mon, 7 Mar 2011 12:49:36 +0000 (14:49 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 30 Mar 2011 17:34:59 +0000 (19:34 +0200)
lib/helper.c

index 81eedec08493682c4f9c57df82cc005334802194..0ba6d4f5d299a90c2f17229e94bf0dd35b3c0c0d 100644 (file)
@@ -227,7 +227,8 @@ static void fuse_unmount_common(const char *mountpoint, struct fuse_chan *ch)
 {
        int fd = ch ? fuse_chan_fd(ch) : -1;
        fuse_kern_unmount(mountpoint, fd);
-       fuse_chan_destroy(ch);
+       if (ch)
+               fuse_chan_destroy(ch);
 }
 
 void fuse_unmount(const char *mountpoint, struct fuse_chan *ch)