diff options
author | Michael Adam <obnox@samba.org> | 2011-12-22 17:18:38 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-12-23 17:39:00 +0100 |
commit | 6e42e03b57769c0cc6ce7cc723af93d5a6372918 (patch) | |
tree | 303749175abed8c739bd492fda0f9770e4a0836c | |
parent | 36462d46f4a61408ba31af2488dd9b2ca1bb659e (diff) | |
download | samba-6e42e03b57769c0cc6ce7cc723af93d5a6372918.tar.gz samba-6e42e03b57769c0cc6ce7cc723af93d5a6372918.tar.xz samba-6e42e03b57769c0cc6ce7cc723af93d5a6372918.zip |
fix zero-initialization of header in _ctdbd_allocate_pkt to the correct size
(This used to be ctdb commit 6c4d1b768ccade344a7462ecad7cf5cbbf3873d4)
-rw-r--r-- | ctdb/client/ctdb_client.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index 224cdc03ee..a580a3e380 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -47,14 +47,13 @@ struct ctdb_req_header *_ctdbd_allocate_pkt(struct ctdb_context *ctdb, length = MAX(length, slength); size = (length+(CTDB_DS_ALIGNMENT-1)) & ~(CTDB_DS_ALIGNMENT-1); - hdr = (struct ctdb_req_header *)talloc_size(mem_ctx, size); + hdr = (struct ctdb_req_header *)talloc_zero_size(mem_ctx, size); if (hdr == NULL) { DEBUG(DEBUG_ERR,("Unable to allocate packet for operation %u of length %u\n", operation, (unsigned)length)); return NULL; } talloc_set_name_const(hdr, type); - memset(hdr, 0, slength); hdr->length = length; hdr->operation = operation; hdr->ctdb_magic = CTDB_MAGIC; |