From: John Hodge Date: Tue, 7 Aug 2012 08:41:12 +0000 (+0800) Subject: Kernel/x86 - Fixed x86 passing NULL to free X-Git-Tag: rel0.15~706^2~65 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=eb44a9b9c61d2b3a16884cb88805a6f5263539e5;p=tpg%2Facess2.git Kernel/x86 - Fixed x86 passing NULL to free --- diff --git a/KernelLand/Kernel/arch/x86/main.c b/KernelLand/Kernel/arch/x86/main.c index b6ac974a..8fcbaefc 100644 --- a/KernelLand/Kernel/arch/x86/main.c +++ b/KernelLand/Kernel/arch/x86/main.c @@ -193,7 +193,9 @@ void Arch_LoadBootModules(void) { Log_Log("Arch", "Loading '%s'", gaArch_BootModules[i].ArgString); - if( !Module_LoadMem( gaArch_BootModules[i].Base, gaArch_BootModules[i].Size, gaArch_BootModules[i].ArgString ) ) + if( !Module_LoadMem( gaArch_BootModules[i].Base, + gaArch_BootModules[i].Size, gaArch_BootModules[i].ArgString + ) ) { Log_Warning("Arch", "Unable to load module"); } @@ -209,5 +211,6 @@ void Arch_LoadBootModules(void) MM_UnmapHWPages( (tVAddr)gaArch_BootModules[i].ArgString, 2 ); } Log_Log("Arch", "Boot modules loaded"); - free( gaArch_BootModules ); + if( gaArch_BootModules ) + free( gaArch_BootModules ); }