Skip to content

Commit f45c021

Browse files
authored
Merge pull request #117 from OrionCummings/main
Fixed memory leak when assessing file permissions in qhash.c
2 parents 93990ec + 3196e1b commit f45c021

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/utilities/qhash.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ bool qhashmd5_file(const char *filepath, off_t offset, ssize_t nbytes,
106106
return false;
107107

108108
struct stat st;
109-
if (fstat(fd, &st) < 0)
109+
if (fstat(fd, &st) < 0) {
110+
close(fd);
110111
return false;
112+
}
111113
size_t size = st.st_size;
112114

113115
// check filesize

0 commit comments

Comments
 (0)