dbwrap_rbt: use talloc_zero_size() instead of a partial ZERO_STRUCT()
authorStefan Metzmacher <metze@samba.org>
Wed, 25 Nov 2015 09:17:34 +0000 (10:17 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 27 Nov 2015 09:10:18 +0000 (10:10 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11394

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/dbwrap/dbwrap_rbt.c

index 0764a2c..37d9649 100644 (file)
@@ -153,7 +153,7 @@ static NTSTATUS db_rbt_store(struct db_record *rec, TDB_DATA data, int flag)
                return NT_STATUS_INSUFFICIENT_RESOURCES;
        }
 
-       node = talloc_size(db_ctx, reclen);
+       node = talloc_zero_size(db_ctx, reclen);
        if (node == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -172,8 +172,6 @@ static NTSTATUS db_rbt_store(struct db_record *rec, TDB_DATA data, int flag)
                 */
        }
 
-       ZERO_STRUCT(node->rb_node);
-
        node->keysize = rec->key.dsize;
        node->valuesize = data.dsize;