Fixed a few file handle leaks
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402432
This commit is contained in:
parent
401c6b445d
commit
ea748cfdbd
@ -236,6 +236,7 @@ SMCResult CGameConfig::ReadSMC_NewSection(const SMCStates *states, const char *n
|
|||||||
s_ServerBinCRC = UTIL_CRC32(buffer, size);
|
s_ServerBinCRC = UTIL_CRC32(buffer, size);
|
||||||
free(buffer);
|
free(buffer);
|
||||||
s_ServerBinCRC_Ok = true;
|
s_ServerBinCRC_Ok = true;
|
||||||
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (error[0] != '\0')
|
if (error[0] != '\0')
|
||||||
|
@ -169,6 +169,8 @@ CPlugin *CPlugin::CreatePlugin(const char *file, char *error, size_t maxlength)
|
|||||||
return pPlugin;
|
return pPlugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
return pPlugin;
|
return pPlugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +141,7 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
|
|||||||
if (hdr.magic != SPFILE_MAGIC)
|
if (hdr.magic != SPFILE_MAGIC)
|
||||||
{
|
{
|
||||||
error = SP_ERROR_FILE_FORMAT;
|
error = SP_ERROR_FILE_FORMAT;
|
||||||
|
fclose(fp);
|
||||||
goto return_error;
|
goto return_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,6 +168,7 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
|
|||||||
free(sectheader);
|
free(sectheader);
|
||||||
free(uncompdata);
|
free(uncompdata);
|
||||||
error = SP_ERROR_DECOMPRESSOR;
|
error = SP_ERROR_DECOMPRESSOR;
|
||||||
|
fclose(fp);
|
||||||
goto return_error;
|
goto return_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,10 +190,13 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
error = SP_ERROR_DECOMPRESSOR;
|
error = SP_ERROR_DECOMPRESSOR;
|
||||||
|
fclose(fp);
|
||||||
goto return_error;
|
goto return_error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
plugin = new sp_plugin_t;
|
plugin = new sp_plugin_t;
|
||||||
|
|
||||||
memset(plugin, 0, sizeof(sp_plugin_t));
|
memset(plugin, 0, sizeof(sp_plugin_t));
|
||||||
|
Loading…
Reference in New Issue
Block a user