If smb_krb5_make_principal() fails without setting the principal,
sdb_entry_free() will try to free whatever memory the uninitialized
member points to.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
goto out;
}
- entry->modified_by = (struct sdb_event *) malloc(sizeof(struct sdb_event));
+ entry->modified_by = calloc(1, sizeof(struct sdb_event));
if (entry->modified_by == NULL) {
ret = ENOMEM;
- krb5_set_error_message(context, ret, "malloc: out of memory");
+ krb5_set_error_message(context, ret, "calloc: out of memory");
goto out;
}