perf arm-spe: 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>
This commit is contained in:
Arnaldo Carvalho de Melo 2023-04-12 09:50:08 -03:00
Родитель 9ccbc21166
Коммит 2e38440054
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -479,7 +479,7 @@ static void arm_spe_recording_free(struct auxtrace_record *itr)
struct arm_spe_recording *sper =
container_of(itr, struct arm_spe_recording, itr);
free(sper->wrapped);
zfree(&sper->wrapped);
free(sper);
}