mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-01 06:45:10 +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. */
|
/* Make sure there is room for the new entry. */
|
||||||
if (env_len + 1 > env_size) {
|
if (env_len + 1 > env_size) {
|
||||||
env_size += 128;
|
env_size += 128;
|
||||||
new_environ = erealloc(new_environ, env_size * sizeof(char *));
|
new_environ = erealloc3(new_environ, env_size, sizeof(char *));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dupcheck) {
|
if (dupcheck) {
|
||||||
|
@@ -291,8 +291,8 @@ load_interfaces()
|
|||||||
/* If the expected size < real size, realloc the array. */
|
/* If the expected size < real size, realloc the array. */
|
||||||
if (n != num_interfaces) {
|
if (n != num_interfaces) {
|
||||||
if (num_interfaces != 0)
|
if (num_interfaces != 0)
|
||||||
interfaces = (struct interface *) erealloc(interfaces,
|
interfaces = (struct interface *) erealloc3(interfaces,
|
||||||
sizeof(struct interface) * num_interfaces);
|
num_interfaces, sizeof(struct interface));
|
||||||
else
|
else
|
||||||
free(interfaces);
|
free(interfaces);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user