summaryrefslogtreecommitdiffstats
path: root/src/fiasco.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fiasco.c')
-rw-r--r--src/fiasco.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/fiasco.c b/src/fiasco.c
index 993b43d..06c8312 100644
--- a/src/fiasco.c
+++ b/src/fiasco.c
@@ -453,9 +453,9 @@ int fiasco_write_to_file(struct fiasco * fiasco, const char * file) {
int fiasco_unpack(struct fiasco * fiasco, const char * dir) {
- int fd = -1;
- char * name = NULL;
- char * layout_name = NULL;
+ int fd;
+ char * name;
+ char * layout_name;
struct image * image;
struct image_list * image_list;
uint32_t size;
@@ -484,6 +484,10 @@ int fiasco_unpack(struct fiasco * fiasco, const char * dir) {
while ( image_list ) {
+ fd = -1;
+ name = NULL;
+ layout_name = NULL;
+
image = image_list->image;
name = image_name_alloc_from_values(image);