OSDN Git Service

perf genelf: 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:12:55 +0000 (10:12 -0300)
commite413f9f13f6a8a591af0ac39ef50af02b42a0df8
treed4cfaaaa8487f91f30e3572a2e6164bdf0899074
parent2bfc8134f95852bd8b0190641c2d2b059cb1c8cc
perf genelf: 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>
tools/perf/util/genelf_debug.c