(hdb_generate_key_set): set ret_key_set before going into the error

clause and freeing key_set. Found by IBM checker.
Make sure ret == 0 after of parse error, we catch the "no entries
parsed" case later.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16929 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-04-02 00:45:48 +00:00
parent 1708cc306c
commit 3e9565a941

View File

@@ -298,6 +298,7 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
&enctypes, &num_enctypes, &salt, principal); &enctypes, &num_enctypes, &salt, principal);
if (ret) { if (ret) {
krb5_warnx(context, "bad value for default_keys `%s'", *kp); krb5_warnx(context, "bad value for default_keys `%s'", *kp);
ret = 0;
continue; continue;
} }
@@ -334,6 +335,8 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
krb5_free_salt(context, salt); krb5_free_salt(context, salt);
} }
*ret_key_set = key_set;
out: out:
if (ret) { if (ret) {
krb5_warn(context, ret, krb5_warn(context, ret,
@@ -348,8 +351,6 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
ret = EINVAL; /* XXX */ ret = EINVAL; /* XXX */
} }
*ret_key_set = key_set;
return ret; return ret;
} }