2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +00:00

Use emalloc/erealloc/estrdup

This commit is contained in:
Todd C. Miller
1999-03-29 02:59:34 +00:00
parent d8947486ec
commit 382ef75493
21 changed files with 146 additions and 365 deletions

View File

@@ -52,9 +52,6 @@
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif /* HAVE_STRINGS_H */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
#include <malloc.h>
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
#include <pwd.h>
#include <signal.h>
#include <time.h>
@@ -158,12 +155,7 @@ void log_error(code)
strlen(runas_user);
if (cmnd_args)
count += strlen(cmnd_args);
logline = (char *) malloc(count);
if (logline == NULL) {
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}
logline = (char *) emalloc(count);
/*
* we will skip this stuff when using syslog(3) but it is