From 3285ebd35ce544fe8d465a3b6b73001ab1e6c5f5 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Tue, 17 Feb 2009 19:28:24 -0500 Subject: [PATCH] don't crash if properties can't be retrieved --- tools/devkit-disks.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/devkit-disks.c b/tools/devkit-disks.c index 462911c..56328b1 100644 --- a/tools/devkit-disks.c +++ b/tools/devkit-disks.c @@ -768,8 +768,10 @@ device_properties_free (DeviceProperties *props) g_free (props->partition_uuid); g_strfreev (props->partition_flags); g_free (props->partition_table_scheme); - g_array_free (props->partition_table_offsets, TRUE); - g_array_free (props->partition_table_sizes, TRUE); + if (props->partition_table_offsets != NULL) + g_array_free (props->partition_table_offsets, TRUE); + if (props->partition_table_sizes != NULL) + g_array_free (props->partition_table_sizes, TRUE); g_free (props->luks_holder); g_free (props->luks_cleartext_slave); g_free (props->drive_model); -- 2.7.4