fix: coverage tests and hash_map_free on NULL

This commit is contained in:
Matteo Flebus 2026-01-30 20:28:38 +01:00
parent 834b6585c5
commit 828b0e8be3
2 changed files with 2 additions and 2 deletions

View file

@ -36,13 +36,13 @@ check_PROGRAMS = testsuite
testsuite_SOURCES = ../tests/unit/utils/utils_tests.c \
../tests/unit/expansion/parse_var.c \
../tests/unit/io_backend/io_backend.c \
../tests/unit/utils/args.c \
../tests/unit/utils/hash_map.c \
../tests/unit/utils/insert_into.c
# ../tests/unit/lexer/lexer_tests.c
# ../tests/unit/expansion/expand.c
# ../tests/unit/io_backend/io_backend.c
testsuite_CPPFLAGS = $(42sh_CPPFLAGS)

View file

@ -116,9 +116,9 @@ void hash_map_free(struct hash_map **hash_map)
}
free((*hash_map)->data);
free(*hash_map);
}
*hash_map = NULL;
}
}
void hash_map_foreach(struct hash_map *hash_map,
void (*fn)(const char *, const void *))