[ioquake3] 64/136: Don't fclose(NULL) if a file doesn't exist.

Simon McVittie smcv at debian.org
Thu Jun 15 09:09:10 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit 67b0cccc75a6eb920f3db4977ec9fb5779f297c3
Author: Ryan C. Gordon <icculus at icculus.org>
Date:   Tue May 30 20:20:18 2017 -0400

    Don't fclose(NULL) if a file doesn't exist.
---
 code/autoupdater/autoupdater.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/code/autoupdater/autoupdater.c b/code/autoupdater/autoupdater.c
index cffbfb5..5cd053b 100644
--- a/code/autoupdater/autoupdater.c
+++ b/code/autoupdater/autoupdater.c
@@ -651,10 +651,10 @@ static void applyUpdates(void)
         }
 
         io = fopen(item->fname, "rb");
-        fclose(io);
         if (io != NULL) {
             static int rollbackIndex = 0;
             char rollbackPath[64];
+            fclose(io);
             item->rollback = ++rollbackIndex;
             snprintf(rollbackPath, sizeof (rollbackPath), "updates/rollbacks/%d", rollbackIndex);
             infof("Moving file for rollback: '%s' -> '%s'", item->fname, rollbackPath);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list