1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

mamake: fix memory leak

This now allows our little make utility to run when compiled with
AddressSanitizer on gcc on Linux; it no longer aborts the build on
exit with a complaint about (very small) memory leaks.
This commit is contained in:
Martijn Dekker 2022-07-15 02:57:17 +02:00
parent b991987642
commit a2c24282a7

View file

@ -27,7 +27,7 @@
* coded for portability * coded for portability
*/ */
#define RELEASE_DATE "2022-06-12" #define RELEASE_DATE "2022-07-15"
static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n"; static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n";
#if _PACKAGE_ast #if _PACKAGE_ast
@ -2127,7 +2127,12 @@ recurse(char* pattern)
*/ */
walk(state.rules, scan, NiL); walk(state.rules, scan, NiL);
state.view = 0; while (state.view)
{
View_t *prev = state.view;
state.view = state.view->next;
free(prev);
}
walk(state.rules, descend, NiL); walk(state.rules, descend, NiL);
return 0; return 0;
} }