summaryrefslogtreecommitdiff
path: root/lib/talloc/talloc.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-12-04 15:35:37 +0100
committerKarolin Seeger <kseeger@samba.org>2015-03-15 22:13:09 +0100
commit32035b08f65908581d50d2da05d42d356fd4adea (patch)
tree2feb6c427eb9c3044d97d04aa296d5f067fe7f5d /lib/talloc/talloc.h
parent19a86f656fc9eae09a67be7622bc254b2732eeee (diff)
downloadsamba-32035b08f65908581d50d2da05d42d356fd4adea.tar.gz
talloc: avoid a function call in TALLOC_FREE() if possible.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit b9fcfc6399eab750880ee0b9806311dd351a8ff6)
Diffstat (limited to 'lib/talloc/talloc.h')
-rw-r--r--lib/talloc/talloc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h
index 5d29a8d5cf0..0d47d23b2ff 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)
/* @} ******************************************************************/