To these conversion functions we sometimes pass malloc-allocated HDB
structures, which we free afterwards if conversion fails. If parts of
these structures are still uninitialized when we try to free them, all
sorts of fun things can result.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
{
int ret;
+ ZERO_STRUCTP(h);
+
h->type = s->type;
ret = smb_krb5_copy_data_contents(&h->salt, s->salt.data, s->salt.length);
if (ret != 0) {
{
int ret, i;
+ ZERO_STRUCTP(h);
+
h->len = s->len;
if (s->val != NULL) {
h->val = malloc(h->len * sizeof(Key));
{
int ret;
+ ZERO_STRUCTP(h);
+
if (s->principal != NULL) {
ret = krb5_copy_principal(context,
s->principal,