Author: timopollmeier
Date: 2016-10-12 11:00:09 +0200 (Wed, 12 Oct 2016)
New Revision: 26374

Modified:
   trunk/openvas-manager/ChangeLog
   trunk/openvas-manager/src/manage_sql.c
Log:
        * src/manage_sql.c (print_report_xml_start): Move g_hash_table_destroy
        calls for success cases so they are always made after printing hosts.

Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog     2016-10-12 08:25:22 UTC (rev 26373)
+++ trunk/openvas-manager/ChangeLog     2016-10-12 09:00:09 UTC (rev 26374)
@@ -1,5 +1,10 @@
 2016-10-12  Timo Pollmeier <timo.pollme...@greenbone.net>
 
+       * src/manage_sql.c (print_report_xml_start): Move g_hash_table_destroy
+       calls for success cases so they are always made after printing hosts.
+
+2016-10-12  Timo Pollmeier <timo.pollme...@greenbone.net>
+
        * src/manage_sql.c (print_report_xml_start): Create hash tables shortly
        before they are created and destroy them when no longer needed.  Also
        rename elements ports and results in hosts to port_count and

Modified: trunk/openvas-manager/src/manage_sql.c
===================================================================
--- trunk/openvas-manager/src/manage_sql.c      2016-10-12 08:25:22 UTC (rev 
26373)
+++ trunk/openvas-manager/src/manage_sql.c      2016-10-12 09:00:09 UTC (rev 
26374)
@@ -28441,12 +28441,6 @@
                  host_iterator_start_time (&hosts));
         }
       cleanup_iterator (&hosts);
-      g_hash_table_destroy (f_host_ports);
-      g_hash_table_destroy (f_host_holes);
-      g_hash_table_destroy (f_host_warnings);
-      g_hash_table_destroy (f_host_infos);
-      g_hash_table_destroy (f_host_logs);
-      g_hash_table_destroy (f_host_false_positives);
 
       init_report_host_iterator (&hosts, report, NULL, 0);
       while (next (&hosts))
@@ -28458,6 +28452,14 @@
                   : "");
       cleanup_iterator (&hosts);
     }
+
+  g_hash_table_destroy (f_host_ports);
+  g_hash_table_destroy (f_host_holes);
+  g_hash_table_destroy (f_host_warnings);
+  g_hash_table_destroy (f_host_infos);
+  g_hash_table_destroy (f_host_logs);
+  g_hash_table_destroy (f_host_false_positives);
+
   end_time = scan_end_time (report);
   PRINT (out,
            "<scan_end>%s</scan_end>",

_______________________________________________
Openvas-commits mailing list
Openvas-commits@wald.intevation.org
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-commits

Reply via email to