summaryrefslogtreecommitdiff
path: root/extmod/vfs_fat_file.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-02-16 11:02:58 +1100
committerDamien George <damien@micropython.org>2024-02-20 10:32:55 +1100
commitcae690d047900b842beaa7798b5362b5646130af (patch)
tree69ff5f9e627bd859c0865ba8223ffe00058ffdf7 /extmod/vfs_fat_file.c
parent4133c0304011ff7be23f47516aac20ed54505e7a (diff)
all: Use mp_obj_malloc_with_finaliser everywhere it's applicable.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod/vfs_fat_file.c')
-rw-r--r--extmod/vfs_fat_file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c
index f82fe4aaa..e2f693769 100644
--- a/extmod/vfs_fat_file.c
+++ b/extmod/vfs_fat_file.c
@@ -228,8 +228,7 @@ STATIC mp_obj_t fat_vfs_open(mp_obj_t self_in, mp_obj_t path_in, mp_obj_t mode_i
}
}
- pyb_file_obj_t *o = m_new_obj_with_finaliser(pyb_file_obj_t);
- o->base.type = type;
+ pyb_file_obj_t *o = mp_obj_malloc_with_finaliser(pyb_file_obj_t, type);
const char *fname = mp_obj_str_get_str(path_in);
FRESULT res = f_open(&self->fatfs, &o->fp, fname, mode);