From 78f93d3055939d93b736f003d8cc25bac6c2df55 Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Mon, 12 May 2008 17:13:11 +0000 Subject: [PATCH] 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 --- lib/framework/frameresource.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/framework/frameresource.c b/lib/framework/frameresource.c index 88ab2c888..138c738cb 100644 --- a/lib/framework/frameresource.c +++ b/lib/framework/frameresource.c @@ -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; }