now sets removes # bogus interfaces from num_interfaces

This commit is contained in:
Todd C. Miller
1995-04-09 02:27:05 +00:00
parent 166d2b78ba
commit 050ca432ac

3
sudo.c
View File

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