Changeset a49c39c8 in mainline


Ignore:
Timestamp:
2018-12-21T17:43:08Z (6 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
59564e6, 8ee106b
Parents:
4a33845 (diff), 7bdedb5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Maurizio Lombardi <m.lombardi85@…> (2018-12-21 17:43:08)
git-committer:
GitHub <noreply@…> (2018-12-21 17:43:08)
Message:

Merge pull request #145 from maurizio-lombardi/ext4_init_dfree

libext4: fix double free in case ext4_filesystem_open() fails.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/src/filesystem.c

    r4a33845 ra49c39c8  
    421421    enum cache_mode cmode, aoff64_t *size, ext4_filesystem_t **rfs)
    422422{
     423        int fs_inited = 0;
    423424        ext4_filesystem_t *fs = NULL;
    424425        fs_node_t *root_node = NULL;
     
    437438        if (rc != EOK)
    438439                goto error;
     440
     441        fs_inited = 1;
    439442
    440443        /* Read root node */
     
    463466                ext4_node_put(root_node);
    464467
    465         if (fs != NULL) {
     468        if (fs_inited)
    466469                ext4_filesystem_fini(fs);
    467                 free(fs);
    468         }
    469 
     470        free(fs);
    470471        return rc;
    471472}
Note: See TracChangeset for help on using the changeset viewer.