diff options
| author | Stefan Metzmacher <metze@samba.org> | 2013-12-04 15:35:37 +0100 |
|---|---|---|
| committer | Stefan Metzmacher <metze@samba.org> | 2014-05-16 17:21:04 +0200 |
| commit | b9fcfc6399eab750880ee0b9806311dd351a8ff6 (patch) | |
| tree | ed83b8d7f40fd1a5b0a5a9a2670269508875055a /lib/talloc | |
| parent | 014eecd0b2aead3a160af0d864feddd53c85b580 (diff) | |
| download | samba-b9fcfc6399eab750880ee0b9806311dd351a8ff6.tar.gz samba-b9fcfc6399eab750880ee0b9806311dd351a8ff6.tar.xz samba-b9fcfc6399eab750880ee0b9806311dd351a8ff6.zip | |
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>
Diffstat (limited to 'lib/talloc')
| -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 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) /* @} ******************************************************************/ |
