summaryrefslogtreecommitdiff
path: root/libparted/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-03-07 18:56:21 +0100
committerJim Meyering <jim@meyering.net>2007-03-07 18:56:21 +0100
commit0915771a4689800e18246b15d1a681cab750bba3 (patch)
tree6b7a97efb736559a4fac620676db805e8ef56ff0 /libparted/tests
parentcb77063c26281dae2dbce6079819c4aad4e15b15 (diff)
downloadparted-0915771a4689800e18246b15d1a681cab750bba3.tar.gz
tests/label: Don't dereference NULL if open fails.
* libparted/tests/label.c (START_TEST): Return right away if ped_device_get returns NULL.
Diffstat (limited to 'libparted/tests')
-rw-r--r--libparted/tests/label.c2
1 files changed, 2 insertions, 0 deletions
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;