removed some unnecessary checks (nw)

This commit is contained in:
Oliver Stöneberg 2012-12-26 13:03:22 +00:00
parent ff3e49d66f
commit f13190914e
2 changed files with 4 additions and 4 deletions

View File

@ -92,13 +92,13 @@ static void tzx_cas_get_blocks( const UINT8 *casdata, int caslen )
if (block_count == max_block_count)
{
void *old_blocks = blocks;
void *old_blocks = blocks;
int old_max_block_count = max_block_count;
max_block_count = max_block_count + BLOCK_COUNT_INCREMENTS;
blocks = (UINT8**)malloc(max_block_count * sizeof(UINT8*)); // SHOULD NOT BE USING auto_alloc_array()
memset(blocks,0,max_block_count);
memset(blocks, 0, max_block_count);
memcpy(blocks, old_blocks, old_max_block_count * sizeof(UINT8*));
if (blocks) free(old_blocks);
free(old_blocks);
}
blocks[block_count] = (UINT8*)&casdata[pos];

View File

@ -1559,7 +1559,7 @@ static imgtoolerr_t fat_construct_dirent(const char *filename, creation_policy_t
/* the short filename suffices; remove the LFN stuff */
memcpy(created_entry, created_entry + created_entry_len - FAT_DIRENT_SIZE, FAT_DIRENT_SIZE);
created_entry_len = FAT_DIRENT_SIZE;
if (created_entry) free(created_entry);
free(created_entry);
new_created_entry = (UINT8 *) malloc(created_entry_len);
if (!new_created_entry)
{