[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1782-g5d2cd81

Volker Lendecke vlendec at samba.org
Mon May 25 14:19:29 GMT 2009


The branch, master has been updated
       via  5d2cd816459a30107b4ea011c1874b051aa29b1c (commit)
      from  95dbd7d6dce2583e785a17d5862a1a16838ec352 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5d2cd816459a30107b4ea011c1874b051aa29b1c
Author: Slava Semushin <php-coder at altlinux.ru>
Date:   Sat May 23 20:51:53 2009 +0700

    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

-----------------------------------------------------------------------

Summary of changes:
 source3/torture/smbiconv.c |    1 +
 source4/torture/smbiconv.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

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;
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list