summaryrefslogtreecommitdiff
path: root/net/irrd/patches/patch-aj
blob: 1b3dab755589e5dff2c7cfbf97c2557896e45f0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$NetBSD: patch-aj,v 1.1 2000/10/07 19:24:16 kim Exp $

Do not try to fclose(NULL).

--- programs/IRRd/database.c.orig	Fri Aug 18 14:42:18 2000
+++ programs/IRRd/database.c	Sat Oct  7 14:59:02 2000
@@ -93,9 +93,13 @@
     HASH_Clear (db->hash_spec);
   }
 
-  trace (NORM, default_trace, "Creating new radix and closing db->fd\n");
+  trace (NORM, default_trace, "Creating new db->radix\n");
   db->radix = New_Radix (128);
-  fclose (db->fd);
+
+  if (db->fd != NULL) {
+    trace (NORM, default_trace, "Closing db->fd\n");
+    fclose (db->fd);
+  }
 
   db->fd = NULL;
   db->db_syntax = EMPTY_DB;