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