|
|
@@ -5555,7 +5555,12 @@ FRESULT f_mkfs (
|
|
|
sz_buf = len / ss; /* Size of working buffer (sector) */
|
|
|
szb_buf = sz_buf * ss; /* Size of working buffer (byte) */
|
|
|
}
|
|
|
- if (!buf || sz_buf == 0) return FR_NOT_ENOUGH_CORE;
|
|
|
+ if (!buf || sz_buf == 0) {
|
|
|
+#if FF_USE_LFN == 3
|
|
|
+ ff_memfree(buf);
|
|
|
+#endif
|
|
|
+ return FR_NOT_ENOUGH_CORE;
|
|
|
+ }
|
|
|
|
|
|
/* Determine where the volume to be located (b_vol, sz_vol) */
|
|
|
if (FF_MULTI_PARTITION && part != 0) {
|