Fixed a few file handle leaks

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402432
This commit is contained in:
Matt Woodrow 2008-07-31 21:08:00 +00:00
parent 401c6b445d
commit ea748cfdbd
3 changed files with 8 additions and 0 deletions

View File

@ -236,6 +236,7 @@ SMCResult CGameConfig::ReadSMC_NewSection(const SMCStates *states, const char *n
s_ServerBinCRC = UTIL_CRC32(buffer, size);
free(buffer);
s_ServerBinCRC_Ok = true;
fclose(fp);
}
}
if (error[0] != '\0')

View File

@ -169,6 +169,8 @@ CPlugin *CPlugin::CreatePlugin(const char *file, char *error, size_t maxlength)
return pPlugin;
}
fclose(fp);
return pPlugin;
}

View File

@ -141,6 +141,7 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
if (hdr.magic != SPFILE_MAGIC)
{
error = SP_ERROR_FILE_FORMAT;
fclose(fp);
goto return_error;
}
@ -167,6 +168,7 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
free(sectheader);
free(uncompdata);
error = SP_ERROR_DECOMPRESSOR;
fclose(fp);
goto return_error;
}
@ -188,10 +190,13 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
default:
{
error = SP_ERROR_DECOMPRESSOR;
fclose(fp);
goto return_error;
}
}
fclose(fp);
plugin = new sp_plugin_t;
memset(plugin, 0, sizeof(sp_plugin_t));