test: fix a memleak in the unit tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-08-07 10:56:20 +10:00
parent 6d46c55df3
commit 119b9c74b0

View file

@ -5,6 +5,8 @@
#include <sys/socket.h>
#include <munit.h>
#include "util-mem.h"
extern const MunitSuite __start_test_section, __stop_test_section;
int
@ -12,7 +14,7 @@ main(int argc, char* argv[MUNIT_ARRAY_PARAM(argc + 1)])
{
size_t sz = 10;
size_t count = 0;
MunitSuite *suites = calloc(sz, sizeof(*suites));
_cleanup_free_ MunitSuite *suites = calloc(sz, sizeof(*suites));
for (const MunitSuite *s = &__start_test_section;
s < &__stop_test_section;