From 050ca432acedac0357f6115aa5c48ec96deed27f Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 9 Apr 1995 02:27:05 +0000 Subject: [PATCH] now sets removes # bogus interfaces from num_interfaces --- sudo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sudo.c b/sudo.c index 219cd49c5..12dcca662 100644 --- a/sudo.c +++ b/sudo.c @@ -683,8 +683,9 @@ static void load_interfaces() /* if there were bogus entries, realloc the array */ if (i != j) { + num_interfaces = j; interfaces = (struct interface *) realloc(interfaces, - sizeof(struct interface) * j); + sizeof(struct interface) * num_interfaces); if (interfaces == NULL) { perror("realloc"); (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);