Avoid using exiting allocators in the front end.

This commit is contained in:
Todd C. Miller
2015-06-17 17:00:54 -06:00
parent 5ce50a885c
commit cb63ca701c
19 changed files with 422 additions and 259 deletions

View File

@@ -41,7 +41,6 @@
#include "sudo_gettext.h" /* must be included before sudo_compat.h */
#include "sudo_compat.h"
#include "sudo_alloc.h"
#include "sudo_fatal.h"
#include "sudo_conf.h"
#include "sudo_debug.h"
@@ -98,7 +97,8 @@ main(int argc, char *argv[], char *envp[])
/* Shift argv and make a copy of the command to execute. */
argv++;
argc--;
cmnd = sudo_estrdup(argv[0]);
if ((cmnd = strdup(argv[0])) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
/* If invoked as a login shell, modify argv[0] accordingly. */
if (login_shell) {