summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-07-05 20:51:40 +0000
committerjstebbins <[email protected]>2009-07-05 20:51:40 +0000
commitefd0ca08bd64bef775f8a6d1e0ea4cb390871afd (patch)
treef6df46202a1cfce56d1ca46d042b23b328f666ae /gtk/src
parent57f4fe88724e9bcf6a1ad20cda96aae8213505dd (diff)
LinGui: Check return values of hal calls
When searching for list of connected dvd drives, system permissions can cause failures that would cause a crash. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2669 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/callbacks.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 4d14b12a6..5ca5a536e 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -3300,10 +3300,14 @@ ghb_is_cd(GDrive *gd)
LibHalDriveType dtype;
device = g_drive_get_identifier(gd, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
+ if (device == NULL)
+ return FALSE;
halDrive = libhal_drive_from_device_file (hal_ctx, device);
+ g_free(device);
+ if (halDrive == NULL)
+ return FALSE;
dtype = libhal_drive_get_type(halDrive);
libhal_drive_free(halDrive);
- g_free(device);
return (dtype == LIBHAL_DRIVE_TYPE_CDROM);
#else
return FALSE;