diff options
author | Jorg Schuler <jcsjcs@users.sourceforge.net> | 2006-02-28 11:06:09 +0000 |
---|---|---|
committer | Jorg Schuler <jcsjcs@users.sourceforge.net> | 2006-02-28 11:06:09 +0000 |
commit | 905fba1f0b04dc26ab0bc985529f1633dacea423 (patch) | |
tree | cf34ae9c1b465e81504950477448c1ff8b3e4030 /src | |
parent | e88c820233a5b8c6a8777d117d8b772db2e771a1 (diff) | |
download | libgpod-905fba1f0b04dc26ab0bc985529f1633dacea423.tar.gz libgpod-905fba1f0b04dc26ab0bc985529f1633dacea423.tar.xz libgpod-905fba1f0b04dc26ab0bc985529f1633dacea423.zip |
* ipod-device.c: (ipod_device_set_property): fixed possible
segfault when hald is present.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1210 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src')
-rw-r--r-- | src/ipod-device.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ipod-device.c b/src/ipod-device.c index 26c25bb..876b566 100644 --- a/src/ipod-device.c +++ b/src/ipod-device.c @@ -1,4 +1,4 @@ -/* Time-stamp: <2006-02-19 19:41:56 jcs> +/* Time-stamp: <2006-02-28 20:04:37 jcs> | | Copyright (C) 2005 Jorg Schuler <jcsjcs at users sourceforge net> | Part of the gtkpod project. @@ -537,33 +537,35 @@ ipod_device_set_property(GObject *object, guint prop_id, case PROP_DEVICE_PATH: case PROP_HAL_VOLUME_ID: str = g_value_get_string(value); + volumes = NULL; if (device->priv->hal_context) { volumes = libhal_manager_find_device_string_match( device->priv->hal_context, "block.device", str, &volume_count, NULL); - if(volume_count == 0) { + if(volume_count == 0) + { libhal_free_string_array(volumes); volumes = libhal_manager_find_device_string_match( device->priv->hal_context, "volume.mount_point", str, &volume_count, NULL); - - if(volume_count >= 1) - str = volumes[0]; - } else { + } + if(volume_count >= 1) + { str = volumes[0]; } - libhal_free_string_array(volumes); } #ifdef HAVE_LIBHAL g_free_if_not_null(device->priv->hal_volume_id); - device->priv->hal_volume_id = g_strdup(str); + device->priv->hal_volume_id = g_strdup (str); #else /* JCS for libgpod */ g_free (device->priv->mount_point); device->priv->mount_point = g_strdup (str); /* end JCS for libgpod */ #endif + if (volumes) + libhal_free_string_array(volumes); device->priv->is_ipod = ipod_device_reload(device); break; case PROP_DEVICE_NAME: |