aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Savola <timo.savola@iki.fi>2017-10-12 20:51:25 +0300
committerNikolaus Rath <Nikolaus@rath.org>2017-10-15 14:31:56 +0100
commit2731a001e5bdce7409550e4c1ce78ff1dfb96a88 (patch)
treef0ce060f0c96ea6c7c61b8e2d0bad2e5371d9c52
parent608e7ab89c7f6c4362f8e9a07133adcd26aa63da (diff)
downloadsshfs-2731a001e5bdce7409550e4c1ce78ff1dfb96a88.tar
sshfs-2731a001e5bdce7409550e4c1ce78ff1dfb96a88.tar.gz
sshfs-2731a001e5bdce7409550e4c1ce78ff1dfb96a88.tar.bz2
sshfs-2731a001e5bdce7409550e4c1ce78ff1dfb96a88.zip
Fix memory leak on opendir error
-rw-r--r--sshfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sshfs.c b/sshfs.c
index a25c637..7fe9c6e 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -2152,7 +2152,8 @@ static int sshfs_opendir(const char *path, struct fuse_file_info *fi)
if (!err) {
buf_finish(handle);
fi->fh = (unsigned long) handle;
- }
+ } else
+ free(handle);
buf_free(&buf);
return err;
}