From 48a6feef402f7b91098341dc6e5eabbfd4beaa91 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 23 Jan 2009 23:15:05 +0100 Subject: talloc_free() copes with a NULL pointer just fine Saved around 10kb of code on my box :-) --- source3/include/smb_macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/smb_macros.h') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 5149da0cb3..92c60a7530 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -256,7 +256,7 @@ NULL returns on zero request. JRA. #define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__) #define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type) #define talloc_destroy(ctx) talloc_free(ctx) -#define TALLOC_FREE(ctx) do { if ((ctx) != NULL) {talloc_free(ctx); ctx=NULL;} } while(0) +#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0) /* only define PARANOID_MALLOC_CHECKER with --enable-developer */ -- cgit