now sets removes # bogus interfaces from num_interfaces
This commit is contained in:
3
sudo.c
3
sudo.c
@@ -683,8 +683,9 @@ static void load_interfaces()
|
|||||||
|
|
||||||
/* if there were bogus entries, realloc the array */
|
/* if there were bogus entries, realloc the array */
|
||||||
if (i != j) {
|
if (i != j) {
|
||||||
|
num_interfaces = j;
|
||||||
interfaces = (struct interface *) realloc(interfaces,
|
interfaces = (struct interface *) realloc(interfaces,
|
||||||
sizeof(struct interface) * j);
|
sizeof(struct interface) * num_interfaces);
|
||||||
if (interfaces == NULL) {
|
if (interfaces == NULL) {
|
||||||
perror("realloc");
|
perror("realloc");
|
||||||
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
|
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
|
||||||
|
Reference in New Issue
Block a user