mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 22:05:46 +00:00
Use erealloc3()
This commit is contained in:
2
env.c
2
env.c
@@ -242,7 +242,7 @@ insert_env(str, dupcheck)
|
||||
/* Make sure there is room for the new entry. */
|
||||
if (env_len + 1 > env_size) {
|
||||
env_size += 128;
|
||||
new_environ = erealloc(new_environ, env_size * sizeof(char *));
|
||||
new_environ = erealloc3(new_environ, env_size, sizeof(char *));
|
||||
}
|
||||
|
||||
if (dupcheck) {
|
||||
|
@@ -291,8 +291,8 @@ load_interfaces()
|
||||
/* If the expected size < real size, realloc the array. */
|
||||
if (n != num_interfaces) {
|
||||
if (num_interfaces != 0)
|
||||
interfaces = (struct interface *) erealloc(interfaces,
|
||||
sizeof(struct interface) * num_interfaces);
|
||||
interfaces = (struct interface *) erealloc3(interfaces,
|
||||
num_interfaces, sizeof(struct interface));
|
||||
else
|
||||
free(interfaces);
|
||||
}
|
||||
|
Reference in New Issue
Block a user