diff options
| author | Arnaldo Carvalho de Melo <[email protected]> | 2019-07-04 15:06:20 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2019-07-09 13:13:27 +0000 |
| commit | d8f9da240495b50766239410f9b0c715ca506a67 (patch) | |
| tree | a9fb3abcc48a72cd34a9299f081aab497325711f /tools/perf/util/llvm-utils.c | |
| parent | tools lib: Adopt zalloc()/zfree() from tools/perf (diff) | |
| download | kernel-d8f9da240495b50766239410f9b0c715ca506a67.tar.gz kernel-d8f9da240495b50766239410f9b0c715ca506a67.zip | |
perf tools: Use zfree() where applicable
In places where the equivalent was already being done, i.e.:
free(a);
a = NULL;
And in placs where struct members are being freed so that if we have
some erroneous reference to its struct, then accesses to freed members
will result in segfaults, which we can detect faster than use after free
to areas that may still have something seemingly valid.
Cc: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/llvm-utils.c')
| -rw-r--r-- | tools/perf/util/llvm-utils.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c index b9fddb809d58..9f0470ecbca9 100644 --- a/tools/perf/util/llvm-utils.c +++ b/tools/perf/util/llvm-utils.c @@ -353,8 +353,7 @@ void llvm__get_kbuild_opts(char **kbuild_dir, char **kbuild_include_opts) " \toption in [llvm] to \"\" to suppress this detection.\n\n", *kbuild_dir); - free(*kbuild_dir); - *kbuild_dir = NULL; + zfree(kbuild_dir); goto errout; } |
