[Openvas-commits] r3506 - in trunk/openvas-libraries: . libopenvascommon

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu May 28 10:15:53 CEST 2009


Author: mattm
Date: 2009-05-28 10:15:53 +0200 (Thu, 28 May 2009)
New Revision: 3506

Modified:
   trunk/openvas-libraries/ChangeLog
   trunk/openvas-libraries/libopenvascommon/nvti.c
Log:
	* libopenvascommon/nvti.c (nvti_to_keyfile): Rename gerror to error.  Free
	error after use.  Add error->message to error message.

Modified: trunk/openvas-libraries/ChangeLog
===================================================================
--- trunk/openvas-libraries/ChangeLog	2009-05-28 08:11:35 UTC (rev 3505)
+++ trunk/openvas-libraries/ChangeLog	2009-05-28 08:15:53 UTC (rev 3506)
@@ -1,5 +1,10 @@
 2009-05-28  Matthew Mundell <mmundell at intevation.de>
 
+	* libopenvascommon/nvti.c (nvti_to_keyfile): Rename gerror to error.  Free
+	error after use.  Add error->message to error message.
+
+2009-05-28  Matthew Mundell <mmundell at intevation.de>
+
 	Add type nvtis for collections of NVT Infos.
 
 	* libopenvascommon/nvti.c (free_nvti_for_hash_table, make_nvtis)

Modified: trunk/openvas-libraries/libopenvascommon/nvti.c
===================================================================
--- trunk/openvas-libraries/libopenvascommon/nvti.c	2009-05-28 08:11:35 UTC (rev 3505)
+++ trunk/openvas-libraries/libopenvascommon/nvti.c	2009-05-28 08:15:53 UTC (rev 3506)
@@ -857,7 +857,7 @@
 {
   GKeyFile *keyfile = g_key_file_new ();
   gchar *text;
-  GError *gerror = NULL;
+  GError *error = NULL;
 
   if (n->oid)
     g_key_file_set_string (keyfile, "NVT Info", "OID", n->oid);
@@ -900,10 +900,12 @@
   if (n->category > 0)
     g_key_file_set_integer (keyfile, "NVT Info", "Category", n->category);
 
-  text = g_key_file_to_data (keyfile, NULL, &gerror);
-  if (gerror != NULL)
+  text = g_key_file_to_data (keyfile, NULL, &error);
+  if (error != NULL)
     {
-      fprintf (stderr, "Error occured while preparing %s\n", fn);
+      fprintf (stderr, "Error occured while preparing %s: %s\n",
+               fn, error->message);
+      g_error_free (error);
     }
   else
     {



More information about the Openvas-commits mailing list