From 829463f8ee1a696cbbfd49eb08e7d78881335213 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sat, 14 Feb 2015 08:48:56 +0100 Subject: Fix resource leak --- autistdraw.c | 12 ++++++------ 1 file 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; } -- cgit v1.2.3-70-g09d2