Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+2 -1
+2 -1
tools/perf/util/genelf_debug.c
··· 11 11 * @author Philippe Elie 12 12 */ 13 13 #include <linux/compiler.h> 14 + #include <linux/zalloc.h> 14 15 #include <sys/types.h> 15 16 #include <stdio.h> 16 17 #include <getopt.h> ··· 91 90 static void 92 91 buffer_ext_exit(struct buffer_ext *be) 93 92 { 94 - free(be->data); 93 + zfree(&be->data); 95 94 } 96 95 97 96 static inline size_t