when leak debugging, free everything even in builtins

This commit is contained in:
tg
2013-02-10 21:17:07 +00:00
parent 51345bd33b
commit f209a252bc
2 changed files with 9 additions and 2 deletions

8
main.c
View File

@ -34,7 +34,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.258 2013/02/10 19:05:37 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.259 2013/02/10 21:17:07 tg Exp $");
extern char **environ;
@ -1046,8 +1046,14 @@ cleanup_parents_env(void)
afree(ep->savefd, &ep->area);
ep->savefd = NULL;
}
#ifdef DEBUG_LEAKS
if (ep->type != E_NONE)
ep->type = E_GONE;
#endif
}
#ifndef DEBUG_LEAKS
e->oenv = NULL;
#endif
}
/* Called just before an execve cleanup stuff temporary files */