From: Volker Lendecke Date: Fri, 23 Jan 2009 22:15:05 +0000 (+0100) Subject: talloc_free() copes with a NULL pointer just fine X-Git-Tag: samba-4.0.0alpha7~422^2~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48a6feef402f7b91098341dc6e5eabbfd4beaa91;p=thirdparty%2Fsamba.git talloc_free() copes with a NULL pointer just fine Saved around 10kb of code on my box :-) --- diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 5149da0cb3d..92c60a7530d 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 */