Many of those warnings are difficult to fix, but this one was easy :-)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 22 07:21:44 CET 2018 on sn-devel-144
return -1;
}
- data = (unsigned char *)malloc(recovery_size + sizeof(*rec));
- if (data == NULL) {
+ rec = malloc(recovery_size + sizeof(*rec));
+ if (rec == NULL) {
tdb->ecode = TDB_ERR_OOM;
return -1;
}
- rec = (struct tdb_record *)data;
memset(rec, 0, sizeof(*rec));
rec->magic = TDB_RECOVERY_INVALID_MAGIC;
rec->key_len = old_map_size;
CONVERT(*rec);
+ data = (unsigned char *)rec;
+
/* build the recovery data into a single blob to allow us to do a single
large write, which should be more efficient */
p = data + sizeof(*rec);