~q3cpma/misc-tools

83ab8697d906e731ee6598145243b0e0909c117d — q3cpma a month ago 023b373 master
Fix a leak in array.h and add -fsanitize=leak in CONFIG=debug
2 files changed, 4 insertions(+), 2 deletions(-)

M array.h
M build.sh
M array.h => array.h +3 -2
@@ 117,7 117,8 @@
#define PTR_GARRAY_FREE(a, free)										\
	do																	\
	{																	\
		for (size_t GENSYM(0) = 0; GENSYM(0) < GARRAY_SIZE(a) - 1; ++GENSYM(0)) \
	        free((a)[GENSYM(0)]);										\
		for (size_t GENSYM(0) = 0; GENSYM(0) < GARRAY_SIZE(a); ++GENSYM(0)) \
			free((a)[GENSYM(0)]);										\
		GARRAY_FREE(a);													\
	}																	\
	while (0)

M build.sh => build.sh +1 -0
@@ 144,6 144,7 @@ case "$(tolower "$CONFIG")" in
			append_ldflag -fsanitize=address
		test_append_cflag -fsanitize=undefined &&
			append_ldflag -fsanitize=undefined
		test_append_ldflag -fsanitize=leak
		;;
	release)
		test_append_cflag -O3 || append_cflag -O1