1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-30 06:50:24 +03:00

ctdb: Use talloc_zero instead of zeroing attributes

Zero entire structure with talloc_zero on memory allocation instead of
setting each attribute individually.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Swen Schillig 2018-02-21 13:52:11 +01:00 committed by Jeremy Allison
parent d6a9dc6e24
commit a2f2bf9e97

View File

@ -86,7 +86,7 @@ int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call,
struct ctdb_registered_call *fn;
struct ctdb_context *ctdb = ctdb_db->ctdb;
c = talloc(mem_ctx, struct ctdb_call_info);
c = talloc_zero(mem_ctx, struct ctdb_call_info);
CTDB_NO_MEMORY(ctdb, c);
c->key = call->key;
@ -94,9 +94,6 @@ int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call,
c->record_data.dptr = talloc_memdup(c, data->dptr, data->dsize);
c->record_data.dsize = data->dsize;
CTDB_NO_MEMORY(ctdb, c->record_data.dptr);
c->new_data = NULL;
c->reply_data = NULL;
c->status = 0;
c->header = header;
for (fn=ctdb_db->calls;fn;fn=fn->next) {