diff options
author | Federico Mena Quintero <federico@novell.com> | 2008-05-10 01:06:38 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2008-05-10 01:06:38 +0000 |
commit | 7b1651ef2b93367b7e364d1a5a0e39c1f0468732 (patch) | |
tree | 21ca147ebb030a5054dfe0acb7555bd01cbb943d | |
parent | 5b1666348316b9b61101287d816772ce09f9076c (diff) | |
download | gvfs-7b1651ef2b93367b7e364d1a5a0e39c1f0468732.tar.gz |
bgo532375 - fix strdup and g_free() confusion
2008-05-09 Federico Mena Quintero <federico@novell.com>
http://bugzilla.gnome.org/show_bug.cgi?id=532375 - Fix strdup() /
g_free() confusion.
* hal/hal-device.c (hal_device_new_from_udi_and_properties):
g_strdup() the UDI. We can't just steal it, since it comes from
libhal, which uses strdup() (and we do g_free() in our finalizer).
* hal/hal-pool.c (hal_pool_new): Free the actual device strings here.
Signed-off-by: Federico Mena Quintero <federico@gnu.org>
svn path=/trunk/; revision=1762
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | hal/hal-device.c | 2 | ||||
-rw-r--r-- | hal/hal-pool.c | 5 |
3 files changed, 16 insertions, 4 deletions
@@ -1,3 +1,12 @@ +2008-05-09 Federico Mena Quintero <federico@novell.com> + + http://bugzilla.gnome.org/show_bug.cgi?id=532375 - Fix strdup() / + g_free() confusion. + + * hal/hal-device.c (hal_device_new_from_udi_and_properties): + g_strdup() the UDI. We can't just steal it, since it comes from + libhal, which uses strdup() (and we do g_free() in our finalizer). + 2008-04-22 Benjamin Otte <otte@gnome.org> * */*.[ch]: get rid of modelines @@ -176,6 +185,10 @@ Post release version bump === gvfs 0.2.2 === +======= + * hal/hal-pool.c (hal_pool_new): Free the actual device strings here. +>>>>>>> bgo532375 - fix strdup and g_free() confusion +2008-05-09 Federico Mena Quintero <federico@novell.com>:ChangeLog 2008-03-28 Alexander Larsson <alexl@redhat.com> diff --git a/hal/hal-device.c b/hal/hal-device.c index 487a1ae5..1899d5da 100644 --- a/hal/hal-device.c +++ b/hal/hal-device.c @@ -243,7 +243,7 @@ hal_device_new_from_udi_and_properties (LibHalContext *hal_ctx, HalDevice *device; device = HAL_DEVICE (g_object_new (HAL_TYPE_DEVICE, NULL)); - device->priv->udi = udi; + device->priv->udi = g_strdup (udi); device->priv->hal_ctx = hal_ctx; device->priv->properties = properties; return device; diff --git a/hal/hal-pool.c b/hal/hal-pool.c index dcbf5256..7a07a3b7 100644 --- a/hal/hal-pool.c +++ b/hal/hal-pool.c @@ -359,9 +359,8 @@ hal_pool_new (char **cap_only) { for (i = 0; i < num_devices; i++) hal_pool_add_device_by_udi_and_properties (pool, devices[i], properties[i], FALSE); - /* _add_device_by_udi_and_properties steals the given parameters */ - free (devices); - free (properties); + libhal_free_string_array (devices); + free (properties); /* hal_pool_add_device_by_udi_and_properties steals the given properties */ goto out; } #endif |