mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 18:13:04 +00:00
perf env: Use zfree() to reduce chances of use after free
Do defensive programming by using zfree() to initialize freed pointers to NULL, so that eventual use after free result in a NULL pointer deref instead of more subtle behaviour. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
313b4c1ccd
commit
9fbde6c800
@ -149,7 +149,7 @@ static void perf_env__purge_bpf(struct perf_env *env)
|
||||
node = rb_entry(next, struct bpf_prog_info_node, rb_node);
|
||||
next = rb_next(&node->rb_node);
|
||||
rb_erase(&node->rb_node, root);
|
||||
free(node->info_linear);
|
||||
zfree(&node->info_linear);
|
||||
free(node);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user