From 67b0cccc75a6eb920f3db4977ec9fb5779f297c3 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 30 May 2017 20:20:18 -0400 Subject: [PATCH] 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 cffbfb52..5cd053bf 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);