Commit 6adccb85 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

dirac: use xcalloc() rather than assert()

assert() is meant only for impossible errors (bugs), not for unlikely
errors. assert() does not check for errors in "release" builds.
parent 1c4f86f5
...@@ -239,8 +239,9 @@ static void dirac_ReleaseBlockAndEncap( block_t *p_block ) ...@@ -239,8 +239,9 @@ static void dirac_ReleaseBlockAndEncap( block_t *p_block )
static void dirac_AddBlockEncap( block_t **pp_block, dirac_block_encap_t *p_dbe ) static void dirac_AddBlockEncap( block_t **pp_block, dirac_block_encap_t *p_dbe )
{ {
fake_block_t *p_fake = calloc( 1, sizeof( *p_fake ) ); /* must not fail, fixby: adding a p_priv to block_t */
assert( p_fake ); /* must not fail, fixby: adding a p_priv to block_t */ fake_block_t *p_fake = xcalloc( 1, sizeof( *p_fake ) );
p_fake->p_orig = *pp_block; p_fake->p_orig = *pp_block;
memcpy( &p_fake->fake, *pp_block, sizeof( block_t ) ); memcpy( &p_fake->fake, *pp_block, sizeof( block_t ) );
*pp_block = &p_fake->fake; *pp_block = &p_fake->fake;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment