ldb: use TALLOC_FREE() over talloc_free() in ldb_filter_attrs()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 26 Aug 2019 02:48:52 +0000 (14:48 +1200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 4 Sep 2019 08:31:24 +0000 (08:31 +0000)
This is a macro that sets the pointer to NULL after the talloc_free()
and is part of our standard coding practices.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
(cherry picked from commit 2117789c35fbf6d0ed02f391f17593e11727ec3e)

lib/ldb/common/ldb_pack.c

index 1d67622b69e3fbc3dbbaee3ea95e5f536359e385..b5e1fbbc4ffc87c805446a4a209c2645ae035ba8 100644 (file)
@@ -1251,8 +1251,7 @@ int ldb_filter_attrs(struct ldb_context *ldb,
                        goto failed;
                }
        } else {
-               talloc_free(filtered_msg->elements);
-               filtered_msg->elements = NULL;
+               TALLOC_FREE(filtered_msg->elements);
        }
 
        return 0;