mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
removed some unnecessary checks (nw)
This commit is contained in:
parent
ff3e49d66f
commit
f13190914e
@ -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];
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user