Changeset 722bb5a in mainline for uspace/lib/label/src/gpt.c


Ignore:
Timestamp:
2016-03-15T15:05:13Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0cfc18d3, 562a48b
Parents:
c064b58
Message:

Do not leak part in gpt_pte_to_part()'s error path
(Thanks to Manuele Conti for catching this.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/label/src/gpt.c

    rc064b58 r722bb5a  
    818818                return EOK;
    819819
    820         part = calloc(1, sizeof(label_part_t));
    821         if (part == NULL)
    822                 return ENOMEM;
    823 
    824820        b0 = uint64_t_le2host(pte->start_lba);
    825821        b1 = uint64_t_le2host(pte->end_lba);
    826822        if (b1 <= b0)
    827823                return EINVAL;
     824
     825        part = calloc(1, sizeof(label_part_t));
     826        if (part == NULL)
     827                return ENOMEM;
    828828
    829829        part->index = index;
Note: See TracChangeset for help on using the changeset viewer.