Fork us on GitHub Follow us on Facebook Follow us on Twitter

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


Ignore:
Timestamp:
2016-03-15T15:05:13Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
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.