summaryrefslogtreecommitdiffstats
path: root/cpukit/libblock
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-01-19 22:05:30 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-01-19 22:05:30 +0000
commitb2ac8a9c4ffb865b9a9ae5cbd1102bb105d2ba8a (patch)
tree7276915c819138c51b100e11daddef40c0f48f5b /cpukit/libblock
parent2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-b2ac8a9c4ffb865b9a9ae5cbd1102bb105d2ba8a.tar.bz2
2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 25 * libblock/src/ide_part_table.c: Add free(sector) on error return path to fix leak.
Diffstat (limited to 'cpukit/libblock')
-rw-r--r--cpukit/libblock/src/ide_part_table.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/libblock/src/ide_part_table.c b/cpukit/libblock/src/ide_part_table.c
index a93728b7f8..a864e0959f 100644
--- a/cpukit/libblock/src/ide_part_table.c
+++ b/cpukit/libblock/src/ide_part_table.c
@@ -192,7 +192,7 @@ data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc)
* - FAT type and non-zero
*/
if (is_extended(part_desc->sys_type) ||
- ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) {
+ ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) {
*new_part_desc = part_desc;
}
else {
@@ -333,6 +333,7 @@ read_mbr(rtems_disk_desc_t *disk_desc)
/* check if the partition table structure is MS-DOS style */
if (!msdos_signature_check(sector))
{
+ free(sector);
return RTEMS_INTERNAL_ERROR;
}