summaryrefslogtreecommitdiff
path: root/source4/heimdal/kdc/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal/kdc/misc.c')
-rw-r--r--source4/heimdal/kdc/misc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/heimdal/kdc/misc.c b/source4/heimdal/kdc/misc.c
index 247cb575de..e016183615 100644
--- a/source4/heimdal/kdc/misc.c
+++ b/source4/heimdal/kdc/misc.c
@@ -65,12 +65,15 @@ _kdc_db_fetch(krb5_context context,
"malformed request: "
"enterprise name with %d name components",
principal->name.name_string.len);
+ free(ent);
return ret;
}
ret = krb5_parse_name(context, principal->name.name_string.val[0],
&enterprise_principal);
- if (ret)
+ if (ret) {
+ free(ent);
return ret;
+ }
principal = enterprise_principal;
}
@@ -98,7 +101,8 @@ _kdc_db_fetch(krb5_context context,
}
}
free(ent);
- krb5_set_error_message(context, HDB_ERR_NOENTRY, "no such entry found in hdb");
+ krb5_set_error_message(context, HDB_ERR_NOENTRY,
+ "no such entry found in hdb");
return HDB_ERR_NOENTRY;
}