Doing the zero initialization per struct member just feels like a way for bugs
to creep in, even when leasev1 is not going to change ever. The only caller has
already zero-initialized state->lease twice via 1) __tevent_req_create() and 2)
a struct initializer of "state".
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
#include "includes.h"
#include "../libcli/smb/smb_common.h"
+/**
+ * Pull a lease off the wire into a struct smb2_lease.
+ *
+ * Note: the caller MUST zero initialize "lease".
+ **/
ssize_t smb2_lease_pull(const uint8_t *buf, size_t len,
struct smb2_lease *lease)
{
switch (version) {
case 1:
- ZERO_STRUCT(lease->parent_lease_key);
- lease->lease_epoch = 0;
break;
case 2:
memcpy(&lease->parent_lease_key, buf+32, 16);