All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] perf script: Add missing closedir() calls
@ 2012-01-07 17:25 Namhyung Kim
  2012-01-07 17:25 ` [PATCH 2/8] perf test: Change type of '-v' option to INCR Namhyung Kim
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Namhyung Kim @ 2012-01-07 17:25 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, linux-kernel

The get_script_path() calls opendir() but misses corresponding
closedir()'s. Add them.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 tools/perf/builtin-script.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index fd1909afcfd6..bb68ddf257b7 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1018,13 +1018,17 @@ static char *get_script_path(const char *script_root, const char *suffix)
 			__script_root = get_script_root(&script_dirent, suffix);
 			if (__script_root && !strcmp(script_root, __script_root)) {
 				free(__script_root);
+				closedir(lang_dir);
+				closedir(scripts_dir);
 				snprintf(script_path, MAXPATHLEN, "%s/%s",
 					 lang_path, script_dirent.d_name);
 				return strdup(script_path);
 			}
 			free(__script_root);
 		}
+		closedir(lang_dir);
 	}
+	closedir(scripts_dir);
 
 	return NULL;
 }
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-01-09  7:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-07 17:25 [PATCH 1/8] perf script: Add missing closedir() calls Namhyung Kim
2012-01-07 17:25 ` [PATCH 2/8] perf test: Change type of '-v' option to INCR Namhyung Kim
2012-01-09  7:23   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 3/8] perf top: Add error message for EMFILE Namhyung Kim
2012-01-09  7:24   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 4/8] perf kmem: Add missing closedir() calls Namhyung Kim
2012-01-09  7:25   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 5/8] perf kmem: Fix a memory leak Namhyung Kim
2012-01-09  7:26   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 6/8] perf annotate: Fix usage string Namhyung Kim
2012-01-09  7:26   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 7/8] perf annotate: Get rid of field_sep check Namhyung Kim
2012-01-09  7:27   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 8/8] perf report: Fix --stdio output alignment when --showcpuutilization used Namhyung Kim
2012-01-09  7:28   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-09  7:23 ` [tip:perf/core] perf script: Add missing closedir() calls tip-bot for Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.