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-861f7616d084master
parent
6bd36ba163
commit
78f93d3055
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue