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:
10
logging.c
10
logging.c
@@ -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
|
||||
|
Reference in New Issue
Block a user