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.
This commit is contained in:
Joel Sherrill
2010-01-19 22:05:30 +00:00
parent 2d2dcab250
commit b2ac8a9c4f
2 changed files with 8 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
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.
2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 5

View File

@@ -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;
}