aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-02-14 08:48:56 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2015-02-14 08:48:56 +0100
commit829463f8ee1a696cbbfd49eb08e7d78881335213 (patch)
treefaf80f21b6d12317208f4f50ff6382df0a66ad78
parent07178d1fa5a6976a61a49b3dd717c375f1fb7171 (diff)
downloadneetdraw-829463f8ee1a696cbbfd49eb08e7d78881335213.tar.gz
neetdraw-829463f8ee1a696cbbfd49eb08e7d78881335213.tar.xz
neetdraw-829463f8ee1a696cbbfd49eb08e7d78881335213.zip
Fix resource leak
-rw-r--r--autistdraw.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/autistdraw.c b/autistdraw.c
index b38eade..72484f7 100644
--- a/autistdraw.c
+++ b/autistdraw.c
@@ -803,18 +803,18 @@ export_irc (app_context_t *app)
static void
load (app_context_t *app)
{
- FILE *fp = fopen ("drawing.bin", "rb");
- if (!fp)
+ // Client cannot load at all, the server would have send the new bitmap out
+ if (app->mode != NETWORK_MODE_STANDALONE)
{
- display ("Error opening file for reading.");
+ display ("Cannot load bitmaps in networked mode.");
beep ();
return;
}
- // Client cannot load at all, the server would have send the new bitmap out
- if (app->mode != NETWORK_MODE_STANDALONE)
+ FILE *fp = fopen ("drawing.bin", "rb");
+ if (!fp)
{
- display ("Cannot load bitmaps in networked mode.");
+ display ("Error opening file for reading.");
beep ();
return;
}