In do_k5_kvno(), free allocated values on success as well as failure.
In t_kdb.py, run kvno with multiple arguments to manifest this leak in
asan and valgrind. Reported by Cel Skeggs.
ticket: 8558
printf(_("%s: kvno = %d\n"), princ, ticket->enc_part.kvno);
}
- continue;
-
- error:
+ cleanup:
if (server != NULL)
krb5_free_principal(context, server);
if (ticket != NULL)
krb5_free_creds(context, out_creds);
if (princ != NULL)
krb5_free_unparsed_name(context, princ);
+ continue;
+
+ error:
errors++;
+ goto cleanup;
}
if (keytab)
expected_msg='Principal: canon@KRBTEST.COM\n')
realm.run([kadminl, 'getprinc', 'canon'],
expected_msg='Principal: canon@KRBTEST.COM\n')
-realm.run([kvno, 'alias'])
-realm.run([kvno, 'canon'])
+realm.run([kvno, 'alias', 'canon'])
out = realm.run([klist])
if 'alias@KRBTEST.COM\n' not in out or 'canon@KRBTEST.COM' not in out:
fail('After fetching alias and canon, klist is missing one or both')