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
+5
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));