[13/13] installer: Fix using uninitialized variables

Message ID 20240405125942.1803058-13-michael.tremer@ipfire.org
State Staged
Commit f102cdc5159c6f1342a8f4a665539f2c26874e9e
Headers
Series [01/13] installer: Update language files |

Commit Message

Michael Tremer April 5, 2024, 12:59 p.m. UTC
  Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 src/installer/main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
  

Patch

diff --git a/src/installer/main.c b/src/installer/main.c
index 944ffa593..70a240ccb 100644
--- a/src/installer/main.c
+++ b/src/installer/main.c
@@ -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."));