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>
#include "tests.h"
#include <api/io.h>
#include <linux/kernel.h>
+#include <linux/zalloc.h>
#define TEMPL "/tmp/perf-test-XXXXXX"
static void cleanup_test(char path[PATH_MAX], struct io *io)
{
- free(io->buf);
+ zfree(&io->buf);
close(io->fd);
unlink(path);
}