diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | libhal-storage/libhal-storage.c | 3 | ||||
-rw-r--r-- | libhal/libhal.c | 7 |
3 files changed, 17 insertions, 1 deletions
@@ -1,3 +1,11 @@ +2006-07-03 Danny Kukawka <danny.kukawka@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. + 2006-06-20 David Zeuthen <davidz@redhat.com> * tools/hal-storage-mount.c (bailout_if_in_fstab): Handle LABEL= diff --git a/libhal-storage/libhal-storage.c b/libhal-storage/libhal-storage.c index 1d16faea..31f234a3 100644 --- a/libhal-storage/libhal-storage.c +++ b/libhal-storage/libhal-storage.c @@ -788,6 +788,8 @@ libhal_drive_free (LibHalDrive *drive) libhal_free_string (drive->model); libhal_free_string (drive->type_textual); libhal_free_string (drive->physical_device); + libhal_free_string (drive->dedicated_icon_drive); + libhal_free_string (drive->dedicated_icon_volume); libhal_free_string (drive->serial); libhal_free_string (drive->firmware_version); libhal_free_string (drive->desired_mount_point); @@ -818,6 +820,7 @@ libhal_volume_free (LibHalVolume *vol) libhal_free_string (vol->desired_mount_point); libhal_free_string (vol->mount_filesystem); libhal_free_string (vol->crypto_backing_volume); + libhal_free_string (vol->storage_device); free (vol); } diff --git a/libhal/libhal.c b/libhal/libhal.c index 7c315867..79139d7e 100644 --- a/libhal/libhal.c +++ b/libhal/libhal.c @@ -73,8 +73,10 @@ libhal_free_string_array (char **str_array) 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 @@ oom: void libhal_free_string (char *str) { - free (str); + if (str != NULL) { + free (str); + str = NULL; + } } |