From 9b570be049bf656489bdce823f6f04beb80f053d Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 15 Aug 2014 02:19:23 +1000 Subject: [PATCH] Bug fix. Must close before freeing the structure. --- src/gfile/inc_fatfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gfile/inc_fatfs.c b/src/gfile/inc_fatfs.c index b5eee725..2e4ef52b 100644 --- a/src/gfile/inc_fatfs.c +++ b/src/gfile/inc_fatfs.c @@ -175,8 +175,8 @@ static bool_t fatfsOpen(GFILE* f, const char* fname) static void fatfsClose(GFILE* f) { if ((FIL*)f->obj != 0) { - gfxFree( (FIL*)f->obj ); f_close( (FIL*)f->obj ); + gfxFree( (FIL*)f->obj ); } }