From 9d4af4f63e298ebf312765a794e39bcca5ad601b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 24 Mar 2015 09:59:50 -0400 Subject: simplify (needed for next commit) --- perl-install/c/stuff.xs.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'perl-install/c') diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index e6bcfa0db..73597cbd7 100755 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -598,8 +598,9 @@ get_disk_partitions(char * device_path) if(dev) { PedDisk* disk = ped_disk_new(dev); PedPartition *part = NULL; - if(disk) - part = ped_disk_next_partition(disk, NULL); + if(!disk) + return; + part = ped_disk_next_partition(disk, NULL); while(part) { if(part->num != -1) { char desc[4196]; @@ -628,8 +629,7 @@ get_disk_partitions(char * device_path) } part = ped_disk_next_partition(disk, part); } - if(disk) - ped_disk_destroy(disk); + ped_disk_destroy(disk); } int -- cgit v1.2.1