fixed a couple of minor memory leaks

This commit is contained in:
Andrew Tridgell 2002-04-01 05:58:57 +02:00
parent 93ef062cc5
commit 65042f0269
2 changed files with 6 additions and 2 deletions

7
args.c
View File

@ -41,6 +41,9 @@ void args_add(ARGS *args, const char *s)
void args_pop(ARGS *args, int n)
{
args->argc -= n;
args->argv[args->argc] = NULL;
while (n--) {
args->argc--;
free(args->argv[args->argc]);
args->argv[args->argc] = NULL;
}
}

View File

@ -285,6 +285,7 @@ static void find_compiler(int argc, char **argv)
struct stat st1, st2;
orig_args = args_init();
free(orig_args->argv);
orig_args->argv = argv;
orig_args->argc = argc;