The Samba-Bugzilla – Attachment 4195 Details for
Bug 6399
[PATCH] File descriptor leak in source{3,4}/torture/smbiconv.c
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix for file descriptor leak in source{3,4}/torture/smbiconv.c
0001-source-3-4-torture-smbiconv.c-main-fixed-file-descri.patch (text/plain), 1.42 KB, created by
Slava Semushin
on 2009-05-23 08:57:10 UTC
(
hide
)
Description:
Fix for file descriptor leak in source{3,4}/torture/smbiconv.c
Filename:
MIME Type:
Creator:
Slava Semushin
Created:
2009-05-23 08:57:10 UTC
Size:
1.42 KB
patch
obsolete
>From 9c062c5b55597fb325b724fb6c4dbc42f754127e Mon Sep 17 00:00:00 2001 >From: Slava Semushin <php-coder@altlinux.ru> >Date: Sat, 23 May 2009 20:51:53 +0700 >Subject: [PATCH] source{3,4}/torture/smbiconv.c(main): fixed file descriptor leak. > >File descriptor leaks only when we use file instead of stdout. > >Found by cppcheck: >[./source3/torture/smbiconv.c:219]: (error) Resource leak: out >[./source4/torture/smbiconv.c:211]: (error) Resource leak: out >--- > source3/torture/smbiconv.c | 1 + > source4/torture/smbiconv.c | 1 + > 2 files changed, 2 insertions(+), 0 deletions(-) > >diff --git a/source3/torture/smbiconv.c b/source3/torture/smbiconv.c >index 72fbdc4..47353d2 100644 >--- a/source3/torture/smbiconv.c >+++ b/source3/torture/smbiconv.c >@@ -216,6 +216,7 @@ int main(int argc, char *argv[]) > cd = smb_iconv_open(to, from); > if (cd == (smb_iconv_t)-1) { > DEBUG(0,("unable to find from or to encoding, exiting...\n")); >+ if (out != stdout) fclose(out); > return 1; > } > >diff --git a/source4/torture/smbiconv.c b/source4/torture/smbiconv.c >index 4eece66..173f371 100644 >--- a/source4/torture/smbiconv.c >+++ b/source4/torture/smbiconv.c >@@ -208,6 +208,7 @@ int main(int argc, char *argv[]) > cd = smb_iconv_open_ex(tctx, to, from, lp_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true)); > if((int)cd == -1) { > DEBUG(0,("unable to find from or to encoding, exiting...\n")); >+ if (out != stdout) fclose(out); > return 1; > } > >-- >1.6.3.1 >
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 6399
: 4195