From 828b0e8be30104cbcca4638840d125ac358805e8 Mon Sep 17 00:00:00 2001 From: Matteo Flebus Date: Fri, 30 Jan 2026 20:28:38 +0100 Subject: [PATCH] fix: coverage tests and hash_map_free on NULL --- src/Makefile.am | 2 +- src/utils/hash_map/hash_map.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3015877..210cac1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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) diff --git a/src/utils/hash_map/hash_map.c b/src/utils/hash_map/hash_map.c index 6f9a513..b07b63d 100644 --- a/src/utils/hash_map/hash_map.c +++ b/src/utils/hash_map/hash_map.c @@ -116,8 +116,8 @@ void hash_map_free(struct hash_map **hash_map) } free((*hash_map)->data); free(*hash_map); + *hash_map = NULL; } - *hash_map = NULL; } void hash_map_foreach(struct hash_map *hash_map,