From 9b10fa47621053c6f138fc9be28e8297d69c5b1a Mon Sep 17 00:00:00 2001 From: axel Date: Sat, 24 Feb 2007 23:19:32 +1000 Subject: [PATCH] Make halloc-based list allocation work without context darcs-hash:20070224131932-ac50b-4523781b1e3cc49e7cd7e3b2e1f21e28b1c5503f.gz --- halloc_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/halloc_util.c b/halloc_util.c index 5b48e0aeb..f195dca0b 100644 --- a/halloc_util.c +++ b/halloc_util.c @@ -37,7 +37,7 @@ array_list_t *al_halloc( void *context ) if( !res ) DIE_MEM(); al_init( res ); - halloc_register_function( context, (void (*)(void *)) &al_destroy, res ); + halloc_register_function( context?context:res, (void (*)(void *)) &al_destroy, res ); return res; } @@ -47,7 +47,7 @@ string_buffer_t *sb_halloc( void *context ) if( !res ) DIE_MEM(); sb_init( res ); - halloc_register_function( context, (void (*)(void *)) &sb_destroy, res ); + halloc_register_function( context?context:res, (void (*)(void *)) &sb_destroy, res ); return res; }