2
0
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:
Todd C. Miller
2012-03-19 11:24:24 -04:00
parent dbbb48c45f
commit 55d1a1a79d
15 changed files with 81 additions and 94 deletions

View File

@@ -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;