Skip to content

Commit 2731a00

Browse files
tsavolaNikratio
authored andcommitted
Fix memory leak on opendir error
1 parent 608e7ab commit 2731a00

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sshfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,8 @@ static int sshfs_opendir(const char *path, struct fuse_file_info *fi)
21522152
if (!err) {
21532153
buf_finish(handle);
21542154
fi->fh = (unsigned long) handle;
2155-
}
2155+
} else
2156+
free(handle);
21562157
buf_free(&buf);
21572158
return err;
21582159
}

0 commit comments

Comments
 (0)