File tree Expand file tree Collapse file tree 1 file changed +2
-20
lines changed
Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -92,27 +92,8 @@ int part_connect_mbr(struct block_device *bd)
9292
9393 //Most likely a VBR
9494 if (valid_partitions == 0 ) {
95-
96- if ((partIndex = GetNextFreePartitionIndex ()) == -1 )
97- {
98- // No more free partition slots.
99- printf ("Can't mount partition, no more free partition slots!\n" );
100- return -1 ;
101- }
102-
103- // Create the pseudo block device for the partition.
104- g_part [partIndex ].bd = bd ;
105- g_part_bd [partIndex ].name = bd -> name ;
106- g_part_bd [partIndex ].devNr = bd -> devNr ;
107- g_part_bd [partIndex ].parNr = 1 ;
108- g_part_bd [partIndex ].parId = 0 ; //Can be any type of (ex)FATxx, is parsed later.
109- g_part_bd [partIndex ].sectorSize = bd -> sectorSize ;
110- g_part_bd [partIndex ].sectorOffset = bd -> sectorOffset ;
111- g_part_bd [partIndex ].sectorCount = bd -> sectorCount ;
112- bdm_connect_bd (& g_part_bd [partIndex ]);
113-
11495 FreeSysMemory (pMbrBlock );
115- return 0 ;
96+ return -1 ;
11697 }
11798
11899 for (int i = 0 ; i < 4 ; i ++ )
@@ -133,6 +114,7 @@ int part_connect_mbr(struct block_device *bd)
133114 {
134115 // No more free partition slots.
135116 printf ("Can't mount partition, no more free partition slots!\n" );
117+ FreeSysMemory (pMbrBlock );
136118 continue ;
137119 }
138120
You can’t perform that action at this time.
0 commit comments