]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
installer: Fix using uninitialized variables
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 5 Apr 2024 12:59:42 +0000 (12:59 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 19 Apr 2024 06:05:35 +0000 (06:05 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/installer/main.c

index 944ffa5936101a41a68b67b42ef897662bea0709..70a240ccbc9d579c4983fb50142a058e78394b61 100644 (file)
@@ -368,6 +368,8 @@ int main(int argc, char *argv[]) {
        char discl_msg[40000] = "Disclaimer\n";
 
        char* sourcedrive = NULL;
+       struct hw_destination* destination = NULL;
+       struct hw_disk** selected_disks = NULL;
        int rc = 0;
        char commandstring[STRING_SIZE];
        int choice;
@@ -589,8 +591,6 @@ int main(int argc, char *argv[]) {
 
        // Scan for disks to install on.
        struct hw_disk** disks = hw_find_disks(hw, sourcedrive);
-
-       struct hw_disk** selected_disks = NULL;
        unsigned int num_selected_disks = 0;
 
        // Check how many disks have been found and what
@@ -720,8 +720,7 @@ int main(int argc, char *argv[]) {
                filesystem = filesystems[fs_choice].fstype;
        }
 
-       struct hw_destination* destination = hw_make_destination(hw, part_type,
-               selected_disks, config.disable_swap, filesystem);
+       destination = hw_make_destination(hw, part_type, selected_disks, config.disable_swap, filesystem);
 
        if (!destination) {
                errorbox(_("Your harddisk is too small."));