selftests/bpf: Fix memory leak on subtest_states reallocation

Fix memory leak in subtest_states reallocation,
and revert subtest_num if allocation fails.

Fixes: 0925225956 ("bpf/selftests: Add granular subtest output for prog_test")
Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
Link: https://lore.kernel.org/bpf/20260723085100.482147-6-yangfeng59949@163.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
This commit is contained in:
Feng Yang 2026-07-23 16:51:00 +08:00 • committed by Kumar Kartikeya Dwivedi
commit 06efb01c65
No known key found for this signature in database
GPG key ID: 472D377B63542F83