The Samba-Bugzilla – Attachment 4444 Details for
Bug 6565
[PATCH] lib/util/util_file.c: possible resource leak in file_save() functions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposal fix
0001-lib-util-util_file.c-file_save-fixed-file-descriptor.patch (text/plain), 787 bytes, created by
Slava Semushin
on 2009-07-18 04:35:01 UTC
(
hide
)
Description:
Proposal fix
Filename:
MIME Type:
Creator:
Slava Semushin
Created:
2009-07-18 04:35:01 UTC
Size:
787 bytes
patch
obsolete
>From cd0a798c199db6e9bb3025d93263d9141ec0aa34 Mon Sep 17 00:00:00 2001 >From: Slava Semushin <php-coder@altlinux.ru> >Date: Sat, 18 Jul 2009 16:28:53 +0700 >Subject: [PATCH] lib/util/util_file.c(file_save): fixed file descriptor leak when read(2) fails. > >Found by cppcheck: >[./lib/util/util_file.c:383]: (error) Resource leak: fd >--- > lib/util/util_file.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > >diff --git a/lib/util/util_file.c b/lib/util/util_file.c >index 0275e78..7466004 100644 >--- a/lib/util/util_file.c >+++ b/lib/util/util_file.c >@@ -380,6 +380,7 @@ _PUBLIC_ bool file_save(const char *fname, const void *packet, size_t length) > return false; > } > if (write(fd, packet, length) != (size_t)length) { >+ close(fd); > return false; > } > close(fd); >-- >1.6.3.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6565
: 4444