mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
Use ecalloc() when allocating structs.
This commit is contained in:
@@ -986,7 +986,7 @@ init_envtables(void)
|
||||
|
||||
/* Fill in the "env_delete" list. */
|
||||
for (p = initial_badenv_table; *p; p++) {
|
||||
cur = emalloc(sizeof(struct list_member));
|
||||
cur = ecalloc(1, sizeof(struct list_member));
|
||||
cur->value = estrdup(*p);
|
||||
cur->next = def_env_delete;
|
||||
def_env_delete = cur;
|
||||
@@ -994,7 +994,7 @@ init_envtables(void)
|
||||
|
||||
/* Fill in the "env_check" list. */
|
||||
for (p = initial_checkenv_table; *p; p++) {
|
||||
cur = emalloc(sizeof(struct list_member));
|
||||
cur = ecalloc(1, sizeof(struct list_member));
|
||||
cur->value = estrdup(*p);
|
||||
cur->next = def_env_check;
|
||||
def_env_check = cur;
|
||||
@@ -1002,7 +1002,7 @@ init_envtables(void)
|
||||
|
||||
/* Fill in the "env_keep" list. */
|
||||
for (p = initial_keepenv_table; *p; p++) {
|
||||
cur = emalloc(sizeof(struct list_member));
|
||||
cur = ecalloc(1, sizeof(struct list_member));
|
||||
cur->value = estrdup(*p);
|
||||
cur->next = def_env_keep;
|
||||
def_env_keep = cur;
|
||||
|
Reference in New Issue
Block a user