fix
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 223b975..b99f9e2 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -11,7 +11,7 @@
 	mount.c			\
 	fuse_lowlevel_i.h
 
-libfuse_la_LDFLAGS = -lpthread -version-number 2:3:1 \
+libfuse_la_LDFLAGS = -lpthread -version-number 2:4:0 \
 	-Wl,--version-script,fuse_versionscript
 
 EXTRA_DIST = fuse_versionscript
diff --git a/lib/fuse.c b/lib/fuse.c
index a849648..a798eaf 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -982,15 +982,14 @@
                       struct fuse_file_info *fi)
 {
     struct fuse *f = req_fuse_prepare(req);
-    char *path;
-    int err;
+    char *path = NULL;
+    int err = 0;
 
-    err = -ENOENT;
     pthread_rwlock_rdlock(&f->tree_lock);
-    path = get_path(f, ino);
-    if (path != NULL) {
-        err = -ENOSYS;
-        if (f->op.open) {
+    if (f->op.open) {
+        err = -ENOENT;
+        path = get_path(f, ino);
+        if (path != NULL) {
             if (!f->compat)
                 err = f->op.open(path, fi);
             else
@@ -1011,7 +1010,7 @@
         pthread_mutex_lock(&f->lock);
         if (fuse_reply_open(req, fi) == -ENOENT) {
             /* The open syscall was interrupted, so it must be cancelled */
-            if(f->op.release) {
+            if(f->op.release && path != NULL) {
                 if (!f->compat)
                     f->op.release(path, fi);
                 else