git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
53f0071
)
source3/torture/vfstest.c(process_file): fixed file descriptor leak.
author
Slava Semushin
<php-coder@altlinux.ru>
Mon, 25 May 2009 16:59:05 +0000
(23:59 +0700)
committer
Volker Lendecke
<vl@samba.org>
Fri, 5 Jun 2009 08:17:09 +0000
(10:17 +0200)
Found by cppcheck:
[./source3/torture/vfstest.c:400]: (error) Resource leak: file
source3/torture/vfstest.c
patch
|
blob
|
history
diff --git
a/source3/torture/vfstest.c
b/source3/torture/vfstest.c
index de68a0b3c52d943061f99f8454593f77998ea8a8..2a191c2800a2fffa0061500edb567388d37bd98b 100644
(file)
--- a/
source3/torture/vfstest.c
+++ b/
source3/torture/vfstest.c
@@
-397,6
+397,10
@@
static void process_file(struct vfs_state *pvfs, char *filename) {
while (fgets(command, 3 * PATH_MAX, file) != NULL) {
process_cmd(pvfs, command);
}
while (fgets(command, 3 * PATH_MAX, file) != NULL) {
process_cmd(pvfs, command);
}
+
+ if (file != stdin) {
+ fclose(file);
+ }
}
void exit_server(const char *reason)
}
void exit_server(const char *reason)