• Namhyung Kim's avatar
    perf test: Fix a memory leak in attr test · 09a61c8f
    Namhyung Kim authored
    The get_argv_exec_path() returns a dynamic memory so it should be
    freed after use.
    
      $ perf test -v 17
      ...
      ==141682==ERROR: LeakSanitizer: detected memory leaks
    
      Direct leak of 33 byte(s) in 1 object(s) allocated from:
        #0 0x7f09107d2e8f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
        #1 0x7f091035f6a7 in __vasprintf_internal libio/vasprintf.c:71
    
      SUMMARY: AddressSanitizer: 33 byte(s) leaked in 1 allocation(s).
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Leo Yan <leo.yan@linaro.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Link: https://lore.kernel.org/r/20210301140409.184570-3-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    09a61c8f
attr.c 5.17 KB