diff options
author | Ulf Lilleengen <lulf@pvv.ntnu.no> | 2008-08-17 17:06:23 +0200 |
---|---|---|
committer | Ulf Lilleengen <lulf@pvv.ntnu.no> | 2008-08-17 17:06:23 +0200 |
commit | 262e5b7a2bb0761f1ca7c01861b2c675d73df3c1 (patch) | |
tree | 838fa555708d3f5460b759adfe7ab352d0d47e4a | |
parent | b8e5a73d12367281bd9d5ecb6d1a6886582fa0d0 (diff) |
- Remember to free memory after path lookup.
- Don't close if fd is 0, which it might be if not assigned.
-rwxr-xr-x | src/mfs_vnops.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mfs_vnops.c b/src/mfs_vnops.c index 07faf44..c97bb35 100755 --- a/src/mfs_vnops.c +++ b/src/mfs_vnops.c @@ -144,6 +144,7 @@ static int mfs_open (const char *path, struct fuse_file_info *fi) if (status != 0) return status; fd = open(realpath, O_RDONLY); + free(realpath); if (fd < 0) return (-errno); fi->fh = (uint64_t)fd; @@ -260,7 +261,7 @@ static int mfs_release(const char *path, struct fuse_file_info *fi) } fd = (int)fi->fh; - if (fd >= 0) + if (fd > 0) close(fd); return (0); |