Prevent null pointer dereference
This commit is contained in:
parent
4db42db980
commit
693a9660f3
|
@ -422,6 +422,10 @@ static void content_flush_save_blocks(struct sram_block **blocks,
|
||||||
for (i = 0; i < num_blocks; i++)
|
for (i = 0; i < num_blocks; i++)
|
||||||
{
|
{
|
||||||
struct sram_block *block = (struct sram_block*)&blocks[i];
|
struct sram_block *block = (struct sram_block*)&blocks[i];
|
||||||
|
|
||||||
|
if (!block || !block->data)
|
||||||
|
continue;
|
||||||
|
|
||||||
free(block->data);
|
free(block->data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue