[Openvas-commits] r5415 - in trunk/openvas-libraries: . base misc nasl

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 7 00:57:41 CEST 2009


Author: timb
Date: 2009-10-07 00:57:40 +0200 (Wed, 07 Oct 2009)
New Revision: 5415

Modified:
   trunk/openvas-libraries/ChangeLog
   trunk/openvas-libraries/base/openvas_certificate_file.c
   trunk/openvas-libraries/misc/network.c
   trunk/openvas-libraries/misc/openvas_auth.c
   trunk/openvas-libraries/nasl/nasl_scanner_glue.c
Log:
Fixed a bunch of memory and resource leaks


Modified: trunk/openvas-libraries/ChangeLog
===================================================================
--- trunk/openvas-libraries/ChangeLog	2009-10-06 22:56:33 UTC (rev 5414)
+++ trunk/openvas-libraries/ChangeLog	2009-10-06 22:57:40 UTC (rev 5415)
@@ -1,3 +1,9 @@
+2009-10-06  Tim Brown <timb at openvas.org>
+
+	* misc/network.c, misc/openvas_auth.c, nasl/nasl_scanner_glue.c
+	base/openvas_certificate_file.c: Fixed a bunch of resource and memory
+	leaks.
+
 2009-10-06  Michael Wiegand <michael.wiegand at intevation.de>
 
 	Post-release version bump.

Modified: trunk/openvas-libraries/base/openvas_certificate_file.c
===================================================================
--- trunk/openvas-libraries/base/openvas_certificate_file.c	2009-10-06 22:56:33 UTC (rev 5414)
+++ trunk/openvas-libraries/base/openvas_certificate_file.c	2009-10-06 22:57:40 UTC (rev 5415)
@@ -130,6 +130,7 @@
     //show_error(_("Error exporting key file: %s"), err->message);
     g_error_free(err);
     g_key_file_free(key_file);
+    close(fd);
     return FALSE;
     }
 

Modified: trunk/openvas-libraries/misc/network.c
===================================================================
--- trunk/openvas-libraries/misc/network.c	2009-10-06 22:56:33 UTC (rev 5414)
+++ trunk/openvas-libraries/misc/network.c	2009-10-06 22:57:40 UTC (rev 5415)
@@ -572,9 +572,10 @@
 }
 
 
-/* helper function copied from cli.c from GnuTLS
- * Reads a file into a gnutls_datum
- */
+/** helper function copied from cli.c from GnuTLS
+ Reads a file into a gnutls_datum
+ @todo Fix the resource leak of FILE *f
+ **/
 static gnutls_datum
 load_file (const char *file)
 {

Modified: trunk/openvas-libraries/misc/openvas_auth.c
===================================================================
--- trunk/openvas-libraries/misc/openvas_auth.c	2009-10-06 22:56:33 UTC (rev 5414)
+++ trunk/openvas-libraries/misc/openvas_auth.c	2009-10-06 22:57:40 UTC (rev 5415)
@@ -153,6 +153,7 @@
   g_free (file_name);
   if (error)
     {
+      g_free (hash);
       g_error_free (error);
       return 1;
     }
@@ -162,6 +163,7 @@
   if (*split == NULL || *seed_hex == NULL)
     {
       g_warning ("Failed to split auth contents.");
+      g_free (hash);
       g_strfreev (split);
       return -1;
     }

Modified: trunk/openvas-libraries/nasl/nasl_scanner_glue.c
===================================================================
--- trunk/openvas-libraries/nasl/nasl_scanner_glue.c	2009-10-06 22:56:33 UTC (rev 5414)
+++ trunk/openvas-libraries/nasl/nasl_scanner_glue.c	2009-10-06 22:57:40 UTC (rev 5415)
@@ -506,6 +506,7 @@
    {
      nasl_perror(lexic, "script_get_preference_file_content: fstat(%s): %s\n",
 		 value, strerror(errno));
+     close(fd);
      return NULL;
    }
 



More information about the Openvas-commits mailing list