summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libzfs/libzfs_import.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c
index b5a079c0e..8afe77af3 100644
--- a/lib/libzfs/libzfs_import.c
+++ b/lib/libzfs/libzfs_import.c
@@ -922,8 +922,10 @@ zpool_clear_label(int fd)
for (l = 0; l < VDEV_LABELS; l++) {
if (pwrite64(fd, label, sizeof (vdev_label_t),
- label_offset(size, l)) != sizeof (vdev_label_t))
+ label_offset(size, l)) != sizeof (vdev_label_t)) {
+ free(label);
return (-1);
+ }
}
free(label);