[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4047 - trunk/OpenDNSSEC/signer/src/signer

Matthijs Mekking matthijs at nlnetlabs.nl
Tue Oct 5 09:58:23 CEST 2010


Author: matthijs
Date: 2010-10-05 09:58:22 +0200 (Tue, 05 Oct 2010)
New Revision: 4047

Modified:
   trunk/OpenDNSSEC/signer/src/signer/zone.c
Log:
close fd
fix segfault (when parse error in .unsorted)



Modified: trunk/OpenDNSSEC/signer/src/signer/zone.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/zone.c	2010-10-05 07:52:53 UTC (rev 4046)
+++ trunk/OpenDNSSEC/signer/src/signer/zone.c	2010-10-05 07:58:22 UTC (rev 4047)
@@ -881,6 +881,7 @@
     se_free((void*)filename);
     if (fd) {
         error = zonedata_recover_from_backup(zone->zonedata, fd);
+        se_fclose(fd);
         if (error) {
             se_log_error("unable to recover denial of existence from file "
             "%s.denial: file corrupted", zone->name);
@@ -918,7 +919,6 @@
     filename = se_build_path(zone->name, ".dnskeys", 0);
     fd = se_fopen(filename, NULL, "r");
     se_free((void*)filename);
-
     if (fd) {
         error = zone_recover_dnskeys_from_backup(zone, fd);
         se_fclose(fd);
@@ -957,9 +957,6 @@
     filename = se_build_path(zone->name, ".task", 0);
     zone->task = task_recover_from_backup((const char*) filename, zone);
     se_free((void*)filename);
-    if (error) {
-        zone->task->what = TASK_READ;
-    }
 
     if (!zone->task) {
         now = time_now();
@@ -968,6 +965,10 @@
     if (!zone->task) {
         se_log_error("failed to create task for zone %s", zone->name);
     } else {
+        if (error) {
+            zone->task->what = TASK_READ;
+        }
+
         task = tasklist_schedule_task(tl, zone->task, 1);
     }
 




More information about the Opendnssec-commits mailing list