diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-12-04 15:35:37 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2015-03-15 22:14:08 +0100 |
commit | 51cc8768d6421737624e08fb2c5305717586cc43 (patch) | |
tree | b77c421ad4fa858e82ccf398150e7d8164168cb0 | |
parent | 61e684859b25673589f44e684ef3e077e5d37d4b (diff) | |
download | samba-51cc8768d6421737624e08fb2c5305717586cc43.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)
-rw-r--r-- | lib/talloc/talloc.h | 2 |
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) /* @} ******************************************************************/ |