Fixed error path to properly close file
This commit is contained in:
parent
eaddb7d24a
commit
a8a5a5b74f
1 changed files with 3 additions and 1 deletions
|
@ -2657,6 +2657,7 @@ if (SizeInBytes > ((uint64)(1024*1024*1024))*2040) {
|
|||
}
|
||||
if (File = sim_fopen (szVHDPath, "rb")) {
|
||||
fclose (File);
|
||||
File = NULL;
|
||||
Status = EEXIST;
|
||||
goto Cleanup_Return;
|
||||
}
|
||||
|
@ -2784,7 +2785,8 @@ if (WriteFilePosition(File,
|
|||
|
||||
Cleanup_Return:
|
||||
free (BAT);
|
||||
fclose (File);
|
||||
if (File)
|
||||
fclose (File);
|
||||
if (Status) {
|
||||
if (Status != EEXIST)
|
||||
remove (szVHDPath);
|
||||
|
|
Loading…
Add table
Reference in a new issue