talloc_free() copes with a NULL pointer just fine
authorVolker Lendecke <vl@samba.org>
Fri, 23 Jan 2009 22:15:05 +0000 (23:15 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 24 Jan 2009 00:05:22 +0000 (01:05 +0100)
Saved around 10kb of code on my box :-)

source3/include/smb_macros.h

index 5149da0cb3dcb9d90edcedaf087820a71b318da9..92c60a7530da77950b2f4600a3a90c4aade65b67 100644 (file)
@@ -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 */