We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0faef9 commit 09a61c8Copy full SHA for 09a61c8
tools/perf/tests/attr.c
@@ -182,14 +182,20 @@ int test__attr(struct test *test __maybe_unused, int subtest __maybe_unused)
182
struct stat st;
183
char path_perf[PATH_MAX];
184
char path_dir[PATH_MAX];
185
+ char *exec_path;
186
187
/* First try development tree tests. */
188
if (!lstat("./tests", &st))
189
return run_dir("./tests", "./perf");
190
191
+ exec_path = get_argv_exec_path();
192
+ if (exec_path == NULL)
193
+ return -1;
194
+
195
/* Then installed path. */
- snprintf(path_dir, PATH_MAX, "%s/tests", get_argv_exec_path());
196
+ snprintf(path_dir, PATH_MAX, "%s/tests", exec_path);
197
snprintf(path_perf, PATH_MAX, "%s/perf", BINDIR);
198
+ free(exec_path);
199
200
if (!lstat(path_dir, &st) &&
201
!lstat(path_perf, &st))
0 commit comments