Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
- struct vkd3d_shader_sm6_block *block;
- sm6->current_block = parent;
- do
- {
unsigned int abbrev_id = shader_sm6_read_bits(parser, parent->abbrev_len);
switch (abbrev_id)
{
case END_BLOCK:
shader_sm6_align_32(parser);
return true;
case ENTER_SUBBLOCK:
if (!(block = vkd3d_malloc(sizeof(*block))) || !vkd3d_array_reserve((void **)&parent->child_blocks,
If `vkd3d_array_reserve()` or `shader_sm6_block_init()` fail, then `block` is not freed.
(if you call `vkd3d_array_reserve()` before `vkd3d_malloc()` then you don't have to care about that path, because `vkd3d_array_reserve()` doesn't leave dangling pointers around)