Skip to content

call free() two times,and err on #821

Open
@pt2go

Description

@pt2go

i have no idea if the file is already close,so i may be call lfs_file_close() two times.
and free() call two times too, this cause an error.
shell we just add one line to bypass ??

static int lfs_file_rawclose(lfs_t *lfs, lfs_file_t *file) {
.....
// clean up memory
if (!file->cfg->buffer) {
lfs_free(file->cache.buffer);
file->cache.buffer = NULL; //+++++++???
}

return err;

}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions