From b9fcfc6399eab750880ee0b9806311dd351a8ff6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 4 Dec 2013 15:35:37 +0100 Subject: [PATCH] talloc: avoid a function call in TALLOC_FREE() if possible. Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- lib/talloc/talloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h index 5d29a8d5cf..0d47d23b2f 100644 --- a/lib/talloc/talloc.h +++ b/lib/talloc/talloc.h @@ -893,7 +893,7 @@ void *_talloc_pooled_object(const void *ctx, * * @param[in] ctx The chunk to be freed. */ -#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0) +#define TALLOC_FREE(ctx) do { if (ctx != NULL) { talloc_free(ctx); ctx=NULL; } } while(0) /* @} ******************************************************************/ -- 2.34.1