Skip to content

Commit

Permalink
Fix memory leak in capable.c
Browse files Browse the repository at this point in the history
This commit adds a cleanup step to free the perf_buffer, fixing a memory leak in the
capable.c file.
  • Loading branch information
yunwei37 authored and chenhengqi committed Aug 20, 2023
1 parent 66cb619 commit b11d0f2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libbpf-tools/capable.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ int main(int argc, char **argv)
}

cleanup:
perf_buffer__free(pb);
capable_bpf__destroy(obj);
syms_cache__free(syms_cache);
ksyms__free(ksyms);
Expand Down

0 comments on commit b11d0f2

Please sign in to comment.