fd leak.
extern int if_fetch(struct interface *ife);
extern int for_all_interfaces(int (*)(struct interface *, void *), void *);
+extern int free_interface_list(void);
extern struct interface *lookup_interface(char *name);
extern int if_readlist(void);
10/1998 partly rewriten by Andi Kleen to support an interface list.
I don't claim that the list operations are efficient @).
- $Id: interface.c,v 1.4 1999/04/21 09:30:32 philip Exp $
+ $Id: interface.c,v 1.5 1999/07/28 21:53:44 philip Exp $
*/
#include "config.h"
return 0;
}
+int free_interface_list(void)
+{
+ struct interface *ife;
+ while ((ife = int_list) != NULL) {
+ int_list = ife->next;
+ free(ife);
+ }
+ return 0;
+}
+
static int if_readconf(void)
{
int numreqs = 30;
* NET-3 Networking Distribution for the LINUX operating
* system.
*
- * Version: $Id: netstat.c,v 1.28 1999/06/12 23:04:15 philip Exp $
+ * Version: $Id: netstat.c,v 1.29 1999/07/28 21:53:34 philip Exp $
*
* Authors: Fred Baumgarten, <dc6iq@insu1.etec.uni-karlsruhe.de>
* Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
perror(_("missing interface information"));
exit(1);
}
- if (!flag_cnt)
- close(skfd);
+ if (flag_cnt)
+ free_interface_list();
+ close(skfd);
skfd = -1;
return 0;