[parted-devel] tests/label: Don't dereference NULL if open fails.
Jim Meyering
jim at meyering.net
Wed Mar 7 18:56:35 CET 2007
FYI:
tests/label: Don't dereference NULL if open fails.
* libparted/tests/label.c (START_TEST): Return right away if
ped_device_get returns NULL.
diff --git a/libparted/tests/label.c b/libparted/tests/label.c
index f12e4c8..c043e37 100644
--- a/libparted/tests/label.c
+++ b/libparted/tests/label.c
@@ -26,6 +26,8 @@ static void destroy_disk(void)
START_TEST (test_create_label)
{
PedDevice *dev = ped_device_get(temporary_disk);
+ if (dev == NULL)
+ return;
PedDiskType *type;
PedDisk *disk;
More information about the parted-devel
mailing list