aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2012-01-07 12:25:25 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-01-08 09:35:41 -0500
commit946ef2a24523e59e5cf931068ab7e9443c63c9df (patch)
treeb354438bcbaf9c41a8df4a5b30b819ec6c5f7698 /tools/perf/builtin-script.c
parentb9f616bbf4a917398aa09db89efbdf9a204e80dc (diff)
perf script: Add missing closedir() calls
The get_script_path() calls opendir() but misses corresponding closedir()'s. Add them. Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1325957132-10600-1-git-send-email-namhyung@gmail.com Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c4
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)
1018 __script_root = get_script_root(&script_dirent, suffix); 1018 __script_root = get_script_root(&script_dirent, suffix);
1019 if (__script_root && !strcmp(script_root, __script_root)) { 1019 if (__script_root && !strcmp(script_root, __script_root)) {
1020 free(__script_root); 1020 free(__script_root);
1021 closedir(lang_dir);
1022 closedir(scripts_dir);
1021 snprintf(script_path, MAXPATHLEN, "%s/%s", 1023 snprintf(script_path, MAXPATHLEN, "%s/%s",
1022 lang_path, script_dirent.d_name); 1024 lang_path, script_dirent.d_name);
1023 return strdup(script_path); 1025 return strdup(script_path);
1024 } 1026 }
1025 free(__script_root); 1027 free(__script_root);
1026 } 1028 }
1029 closedir(lang_dir);
1027 } 1030 }
1031 closedir(scripts_dir);
1028 1032
1029 return NULL; 1033 return NULL;
1030} 1034}