diff options
Diffstat (limited to 'tools/perf/util/exec_cmd.c')
-rw-r--r-- | tools/perf/util/exec_cmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/exec_cmd.c b/tools/perf/util/exec_cmd.c index c1b3d34e5716..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) slash--; if (slash >= argv0) { - argv0_path = xstrndup(argv0, slash - argv0); - return slash + 1; + argv0_path = strndup(argv0, slash - argv0); + return argv0_path ? slash + 1 : NULL; } return argv0; |