From: Swen Schillig Date: Wed, 21 Feb 2018 12:52:11 +0000 (+0100) Subject: ctdb: Use talloc_zero instead of zeroing attributes X-Git-Tag: talloc-2.1.13~103 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2f2bf9e9706bc47c3d26ae40b7bb9658b8a9fa5;p=thirdparty%2Fsamba.git 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 Reviewed-by: Martin Schwenke Reviewed-by: Jeremy Allison --- diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index c3bb435a641..a7624b7e3c8 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -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) {