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")) {
|
if (File = sim_fopen (szVHDPath, "rb")) {
|
||||||
fclose (File);
|
fclose (File);
|
||||||
|
File = NULL;
|
||||||
Status = EEXIST;
|
Status = EEXIST;
|
||||||
goto Cleanup_Return;
|
goto Cleanup_Return;
|
||||||
}
|
}
|
||||||
|
@ -2784,6 +2785,7 @@ if (WriteFilePosition(File,
|
||||||
|
|
||||||
Cleanup_Return:
|
Cleanup_Return:
|
||||||
free (BAT);
|
free (BAT);
|
||||||
|
if (File)
|
||||||
fclose (File);
|
fclose (File);
|
||||||
if (Status) {
|
if (Status) {
|
||||||
if (Status != EEXIST)
|
if (Status != EEXIST)
|
||||||
|
|
Loading…
Add table
Reference in a new issue