summaryrefslogtreecommitdiffstats
path: root/align/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'align/scan.c')
-rw-r--r--align/scan.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/align/scan.c b/align/scan.c
index 529add53..7b4631ab 100644
--- a/align/scan.c
+++ b/align/scan.c
@@ -228,9 +228,13 @@ scan (void)
struct guestfs_partition_list *parts;
devices = guestfs_list_devices (g);
+ if (devices == NULL)
+ exit (EXIT_FAILURE);
for (i = 0; devices[i] != NULL; ++i) {
parts = guestfs_part_list (g, devices[i]);
+ if (parts == NULL)
+ exit (EXIT_FAILURE);
/* Canonicalize the name of the device for printing. */
if (STRPREFIX (devices[i], "/dev/") &&