Package: bird
Severity: important
Tags: patch

Hi,

bird does not close the configuration file, and every time a reconfigure
is issued it opens again the same file leaking file descriptors.

Attached patch fixes the problem.

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.23.14
Locale: LANG=es_GT.UTF-8, LC_CTYPE=es_GT.UTF-8 (charmap=UTF-8)
diff -urN --exclude debian bird-1.0.11.orig/sysdep/unix/main.c bird-1.0.11/sysdep/unix/main.c
--- bird-1.0.11.orig/sysdep/unix/main.c	2004-06-06 11:05:25.000000000 -0600
+++ bird-1.0.11/sysdep/unix/main.c	2008-01-23 17:36:49.000000000 -0600
@@ -91,13 +91,16 @@
 unix_read_config(struct config **cp, char *name)
 {
   struct config *conf = config_alloc(name);
+  int ret;
 
   *cp = conf;
   conf_fd = open(name, O_RDONLY);
   if (conf_fd < 0)
     return 0;
   cf_read_hook = cf_read;
-  return config_parse(conf);
+  ret = config_parse(conf);
+  close(conf_fd);
+  return ret;
 }
 
 static void

Reply via email to