diff options
author | Bastien Nocera <hadess@hadess.net> | 2009-02-03 11:32:18 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2009-02-03 11:32:18 +0000 |
commit | fca96a55b11809719a247bc02d744aee31826733 (patch) | |
tree | 5b073a8a24a82687d6b09106a8df37caf1d558c8 /daemon/gvfsbackendobexftp.c | |
parent | 534c3bd6e6475b4ef7ebcd041d3cf45d3f0df7cb (diff) | |
download | gvfs-fca96a55b11809719a247bc02d744aee31826733.tar.gz |
Fix possible double-free when the display name is freed Avoid errors when
2009-02-03 Bastien Nocera <hadess@hadess.net>
* daemon/gvfsbackendobexftp.c (do_mount): Fix
possible double-free when the display name is freed
Avoid errors when the icon name couldn't be gathered
svn path=/trunk/; revision=2193
Diffstat (limited to 'daemon/gvfsbackendobexftp.c')
-rw-r--r-- | daemon/gvfsbackendobexftp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/daemon/gvfsbackendobexftp.c b/daemon/gvfsbackendobexftp.c index 60398eb6..2c457f9f 100644 --- a/daemon/gvfsbackendobexftp.c +++ b/daemon/gvfsbackendobexftp.c @@ -882,7 +882,9 @@ do_mount (GVfsBackend *backend, } op_backend->display_name = _get_bluetooth_device_properties (op_backend->bdaddr, &op_backend->icon_name); if (!op_backend->display_name) - op_backend->display_name = g_strdelimit (op_backend->bdaddr, ":", '-'); + op_backend->display_name = g_strdelimit (g_strdup (op_backend->bdaddr), ":", '-'); + if (!op_backend->icon_name) + op_backend->icon_name = g_strdup ("bluetooth"); g_print (" do_mount: %s (%s) mounted\n", op_backend->display_name, op_backend->bdaddr); } else |