Free memory after we are done with it.

This commit is contained in:
Todd C. Miller
2010-05-07 10:14:12 -04:00
parent 247f7acaaf
commit b08a96eea7

View File

@@ -372,6 +372,7 @@ my_execve(const char *path, char *const argv[], char *const envp[])
nargv[1] = (char *)path; nargv[1] = (char *)path;
memcpy(nargv + 2, argv + 1, argc * sizeof(char *)); memcpy(nargv + 2, argv + 1, argc * sizeof(char *));
execve(_PATH_BSHELL, nargv, envp); execve(_PATH_BSHELL, nargv, envp);
efree(nargv);
} }
return -1; return -1;
} }
@@ -825,6 +826,12 @@ io_error:
} }
} }
} }
efree(fdsr);
efree(fdsw);
while ((iob = iobufs) != NULL) {
iobufs = iobufs->next;
efree(iob);
}
return cstat->type == CMD_ERRNO ? -1 : 0; return cstat->type == CMD_ERRNO ? -1 : 0;
} }