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 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>

+2 -1
+2 -1
tools/perf/util/annotate.c
··· 38 38 #include <linux/bitops.h> 39 39 #include <linux/kernel.h> 40 40 #include <linux/string.h> 41 + #include <linux/zalloc.h> 41 42 #include <subcmd/parse-options.h> 42 43 #include <subcmd/run-command.h> 43 44 ··· 1882 1881 if (dl) 1883 1882 annotation_line__add(&dl->al, &notes->src->source); 1884 1883 1885 - free(args->line); 1884 + zfree(&args->line); 1886 1885 return 0; 1887 1886 } 1888 1887