Reduce code duplication that occurs in both branches of an if-statement

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5071 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-05-12 17:13:11 +00:00
parent 6bd36ba163
commit 78f93d3055
1 changed files with 3 additions and 4 deletions

View File

@ -95,6 +95,7 @@ void resSetBaseDir(const char* pResDir)
/* Parse the res file */
BOOL resLoad(const char *pResFile, SDWORD blockID)
{
bool retval = true;
char *pBuffer;
UDWORD size;
@ -117,15 +118,13 @@ BOOL resLoad(const char *pResFile, SDWORD blockID)
if (res_parse() != 0)
{
debug(LOG_ERROR, "resLoad: failed to parse %s", pResFile);
res_lex_destroy();
free(pBuffer);
return false;
retval = false;
}
res_lex_destroy();
free(pBuffer);
return true;
return retval;
}