From: Pasi Kallinen Date: Tue, 1 Dec 2009 21:53:28 +0000 (+0000) Subject: Close the file after checking it exists. X-Git-Tag: v1.6.1-roc-dev~190 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=4a258cc7752e2bd8feff1b336be611c95e3f2256;p=dgamelaunch Close the file after checking it exists. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@519 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- diff --git a/dgl-common.c b/dgl-common.c index 9c52c01..2ccb723 100644 --- a/dgl-common.c +++ b/dgl-common.c @@ -211,7 +211,10 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me) if (p1 && p2) { FILE *tmpfile; tmpfile = fopen(p2, "r"); - if (tmpfile) break; + if (tmpfile) { + fclose(tmpfile); + break; + } } /* else fall through to cp */ case DGLCMD_CP: