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 <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-jatyoofo5boc1bsvoig6bb6i@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -1353,7 +1353,7 @@ static void free_streams(struct ctf_writer *cw)
|
||||
for (cpu = 0; cpu < cw->stream_cnt; cpu++)
|
||||
ctf_stream__delete(cw->stream[cpu]);
|
||||
|
||||
free(cw->stream);
|
||||
zfree(&cw->stream);
|
||||
}
|
||||
|
||||
static int ctf_writer__setup_env(struct ctf_writer *cw,
|
||||
|
Reference in New Issue
Block a user