summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorSlava Semushin <php-coder@altlinux.ru>2009-05-23 20:51:53 +0700
committerVolker Lendecke <vl@samba.org>2009-05-25 16:18:48 +0200
commit5d2cd816459a30107b4ea011c1874b051aa29b1c (patch)
treeb0ccd2bb9c020ab42663dfb96a8e1d46104a5bad /source3/torture
parent95dbd7d6dce2583e785a17d5862a1a16838ec352 (diff)
downloadsamba-5d2cd816459a30107b4ea011c1874b051aa29b1c.tar.gz
samba-5d2cd816459a30107b4ea011c1874b051aa29b1c.tar.bz2
samba-5d2cd816459a30107b4ea011c1874b051aa29b1c.zip
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
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/smbiconv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source3/torture/smbiconv.c b/source3/torture/smbiconv.c
index 72fbdc470f..47353d2a94 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;
}