Fix resource leak

This commit is contained in:
Přemysl Eric Janouch 2015-02-14 08:48:56 +01:00
parent 07178d1fa5
commit 829463f8ee
1 changed files with 8 additions and 8 deletions

View File

@ -803,14 +803,6 @@ export_irc (app_context_t *app)
static void static void
load (app_context_t *app) load (app_context_t *app)
{ {
FILE *fp = fopen ("drawing.bin", "rb");
if (!fp)
{
display ("Error opening file for reading.");
beep ();
return;
}
// Client cannot load at all, the server would have send the new bitmap out // Client cannot load at all, the server would have send the new bitmap out
if (app->mode != NETWORK_MODE_STANDALONE) if (app->mode != NETWORK_MODE_STANDALONE)
{ {
@ -819,6 +811,14 @@ load (app_context_t *app)
return; return;
} }
FILE *fp = fopen ("drawing.bin", "rb");
if (!fp)
{
display ("Error opening file for reading.");
beep ();
return;
}
// Some way of loading/saving is better than no way, let's just do our job. // Some way of loading/saving is better than no way, let's just do our job.
// The format neither standardised nor effective but it works for us. // The format neither standardised nor effective but it works for us.
// We just eat everything and make sure to not crash. // We just eat everything and make sure to not crash.