aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/exec_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/exec_cmd.c')
-rw-r--r--tools/perf/util/exec_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/exec_cmd.c b/tools/perf/util/exec_cmd.c
index 2745605dba11..67eeff571568 100644
--- a/tools/perf/util/exec_cmd.c
+++ b/tools/perf/util/exec_cmd.c
@@ -53,8 +53,8 @@ const char *perf_extract_argv0_path(const char *argv0)
53 slash--; 53 slash--;
54 54
55 if (slash >= argv0) { 55 if (slash >= argv0) {
56 argv0_path = xstrndup(argv0, slash - argv0); 56 argv0_path = strndup(argv0, slash - argv0);
57 return slash + 1; 57 return argv0_path ? slash + 1 : NULL;
58 } 58 }
59 59
60 return argv0; 60 return argv0;
@@ -116,7 +116,7 @@ void setup_path(void)
116 strbuf_release(&new_path); 116 strbuf_release(&new_path);
117} 117}
118 118
119const char **prepare_perf_cmd(const char **argv) 119static const char **prepare_perf_cmd(const char **argv)
120{ 120{
121 int argc; 121 int argc;
122 const char **nargv; 122 const char **nargv;