Re: [PATCH v1 4/6] perf annotate: Own objdump_path and disassembler_style strings
From: Arnaldo Carvalho de Melo
Date: Wed Mar 29 2023 - 09:17:55 EST
Em Tue, Mar 28, 2023 at 04:55:41PM -0700, Ian Rogers escreveu:
> @@ -3231,8 +3235,10 @@ void annotation_options__init(struct annotation_options *opt)
> }
>
>
> -void annotation_options__exit(struct annotation_options *opt __maybe_unused)
> +void annotation_options__exit(struct annotation_options *opt)
> {
> + free(opt->disassembler_style);
> + free(opt->objdump_path);
> }
Changed this:
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 7338249dfdd94390..08e041a9b9cc279e 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -3237,8 +3237,8 @@ void annotation_options__init(struct annotation_options *opt)
void annotation_options__exit(struct annotation_options *opt)
{
- free(opt->disassembler_style);
- free(opt->objdump_path);
+ zfree(&opt->disassembler_style);
+ zfree(&opt->objdump_path);
}
void annotation_config__init(struct annotation_options *opt)