From 82e1f65536a75be6141715da81a7cd1e626f18e2 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sat, 23 May 2009 01:10:05 +0700 Subject: [PATCH 1/2] source3/utils/log2pcaphex.c(main): fixed file descriptors leak. One of leaks found by cppcheck: [./source3/utils/log2pcaphex.c:367]: (error) Resource leak: out --- source3/utils/log2pcaphex.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/source3/utils/log2pcaphex.c b/source3/utils/log2pcaphex.c index 072d659..b1a8a27 100644 --- a/source3/utils/log2pcaphex.c +++ b/source3/utils/log2pcaphex.c @@ -364,5 +364,13 @@ int main (int argc, char **argv) } } + if (in != stdin) { + fclose(in); + } + + if (out != stdout) { + fclose(out); + } + return 0; } -- 1.6.3.1