diff options
author | Slava Semushin <php-coder@altlinux.ru> | 2009-07-18 23:30:33 +0700 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-07-19 16:01:12 +0200 |
commit | 11fa3ed9ee1a05aabdba902db9899dfeb664b324 (patch) | |
tree | 4afc639c565ca491e652b5d861aa9a393ba21535 | |
parent | 5f8df164716a43bd9e6c22dfd1f066bf96ccf273 (diff) | |
download | samba-11fa3ed9ee1a05aabdba902db9899dfeb664b324.tar.gz samba-11fa3ed9ee1a05aabdba902db9899dfeb664b324.tar.bz2 samba-11fa3ed9ee1a05aabdba902db9899dfeb664b324.zip |
source4/lib/registry/patchfile.c(reg_diff_load): fixed possible resource leak.
File descriptor leaks when write(2) fails and we are returning from
function.
Found by cppcheck:
[./source4/lib/registry/patchfile.c:319]: (error) Resource leak: fd
-rw-r--r-- | source4/lib/registry/patchfile.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source4/lib/registry/patchfile.c b/source4/lib/registry/patchfile.c index 925806985e..24d86abf48 100644 --- a/source4/lib/registry/patchfile.c +++ b/source4/lib/registry/patchfile.c @@ -316,6 +316,7 @@ _PUBLIC_ WERROR reg_diff_load(const char *filename, if (read(fd, &hdr, 4) != 4) { DEBUG(0, ("Error reading registry patch file `%s'\n", filename)); + close(fd); return WERR_GENERAL_FAILURE; } |