diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-01-19 23:47:41 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-01-19 23:47:41 +0000 |
commit | b61ad658f1d5e48445e601e99234289d27043c33 (patch) | |
tree | c7df104032d31f0408d3870d1d64c4c8a83653ca /cpukit | |
parent | 2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-b61ad658f1d5e48445e601e99234289d27043c33.tar.bz2 |
2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* libblock/src/ide_part_table.c: Another error path without a
free(sector).
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/libblock/src/ide_part_table.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index c696696f98..32b8ab0599 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,10 @@ 2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com> + * libblock/src/ide_part_table.c: Another error path without a + free(sector). + +2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com> + Coverity Id 28 * libcsupport/src/termios.c: Set then unconditionally to avoid potential paths where it might be used uninitialized. Recommended by diff --git a/cpukit/libblock/src/ide_part_table.c b/cpukit/libblock/src/ide_part_table.c index c11660b7b6..f9a942c510 100644 --- a/cpukit/libblock/src/ide_part_table.c +++ b/cpukit/libblock/src/ide_part_table.c @@ -223,7 +223,7 @@ read_extended_partition(uint32_t start, rtems_part_desc_t *ext_part) { int i; dev_t dev; - rtems_sector_data_t *sector; + rtems_sector_data_t *sector = NULL; uint32_t here; uint8_t *data; rtems_part_desc_t *new_part_desc; @@ -244,11 +244,14 @@ read_extended_partition(uint32_t start, rtems_part_desc_t *ext_part) rc = get_sector(dev, here, §or); if (rc != RTEMS_SUCCESSFUL) { + if (sector) + free(sector); return rc; } if (!msdos_signature_check(sector)) { + free(sector); return RTEMS_INTERNAL_ERROR; } |