hal/libhal libhal.c,1.59,1.60

Danny Kukawka dkukawka at kemper.freedesktop.org
Mon Jul 3 09:42:03 PDT 2006


Update of /cvs/hal/hal/libhal
In directory kemper:/tmp/cvs-serv12884/libhal

Modified Files:
	libhal.c 
Log Message:
2006-07-03  Danny Kukawka  <danny.kukawka at web.de>

        * libhal-storage/libhal-storage.c: (libhal_drive_free),
        (libhal_volume_free): set pointer adress to NULL after free()

        * libhal/libhal.c: (libhal_free_string_array),
        (libhal_free_string): Fixed some memory leaks.



Index: libhal.c
===================================================================
RCS file: /cvs/hal/hal/libhal/libhal.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- libhal.c	9 Jun 2006 02:19:32 -0000	1.59
+++ libhal.c	3 Jul 2006 16:42:01 -0000	1.60
@@ -73,8 +73,10 @@
 
 		for (i = 0; str_array[i] != NULL; i++) {
 			free (str_array[i]);
+			str_array[i] = NULL;
 		}
 		free (str_array);
+		str_array = NULL;
 	}
 }
 
@@ -148,7 +150,10 @@
 void
 libhal_free_string (char *str)
 {
-	free (str);
+	if (str != NULL) {
+		free (str);
+		str = NULL;
+	}
 }
 
 




More information about the hal-commit mailing list