summaryrefslogtreecommitdiffstats
path: root/perl-install/c/stuff.xs.pl
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/c/stuff.xs.pl')
-rwxr-xr-xperl-install/c/stuff.xs.pl8
1 files changed, 4 insertions, 4 deletions
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