X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FFilesystems%2FFAT%2Ffat.c;h=d6025104cfcbe770a2b15ef347c768c1ca530d1b;hb=25b02822ad95feb8f82f7b8fef44a58e29afb79b;hp=bb90c3cfd49a7b1fbc8d1792f776e28685cf912f;hpb=97159caf60a26cff3cc8f52e050a44d2492430f8;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Filesystems/FAT/fat.c b/KernelLand/Modules/Filesystems/FAT/fat.c index bb90c3cf..d6025104 100644 --- a/KernelLand/Modules/Filesystems/FAT/fat.c +++ b/KernelLand/Modules/Filesystems/FAT/fat.c @@ -105,6 +105,7 @@ tVFS_Node *FAT_InitDevice(const char *Device, const char **Options) if(bs->bps == 0 || bs->spc == 0) { Log_Notice("FAT", "Error in FAT Boot Sector (zero BPS/SPC)"); + VFS_Close(diskInfo->fileHandle); return NULL; } @@ -185,6 +186,7 @@ tVFS_Node *FAT_InitDevice(const char *Device, const char **Options) diskInfo->FATCache = (Uint32*)malloc(sizeof(Uint32)*diskInfo->ClusterCount); if(diskInfo->FATCache == NULL) { Log_Warning("FAT", "Heap Exhausted"); + VFS_Cose(diskInfo->fileHandle); return NULL; } Ofs = bs->resvSectCount*512;