OSDN Git Service

perf annotate: Use zfree() to reduce chances of use after free
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 Apr 2023 12:50:08 +0000 (09:50 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 Apr 2023 13:08:30 +0000 (10:08 -0300)
commitc77ceb2eb03eefd92e6b84a509ecec1db8d97858
tree1ab8316a7b1698b0478942bfb94fe2f17c419d0f
parent25feb605fe3b2674142d084379e0737a99945aba
perf annotate: 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.

Also include the missing linux/zalloc.h header directive.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.c