Fix resource leak
This commit is contained in:
parent
07178d1fa5
commit
829463f8ee
16
autistdraw.c
16
autistdraw.c
|
@ -803,14 +803,6 @@ export_irc (app_context_t *app)
|
|||
static void
|
||||
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
|
||||
if (app->mode != NETWORK_MODE_STANDALONE)
|
||||
{
|
||||
|
@ -819,6 +811,14 @@ load (app_context_t *app)
|
|||
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.
|
||||
// The format neither standardised nor effective but it works for us.
|
||||
// We just eat everything and make sure to not crash.
|
||||
|
|
Loading…
Reference in New Issue