(init_creds_init_as_req): in AS-REQ the cname must always be given,

don't avoid that fact and remove a cname == NULL case. Plugs a memory
leak found by IBM checker.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16940 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-04-02 01:20:15 +00:00
parent 0c29fd2ed1
commit fd1ea1cc54

View File

@@ -547,23 +547,14 @@ init_creds_init_as_req (krb5_context context,
krb5_set_error_string(context, "malloc: out of memory");
goto fail;
}
if (creds->client) {
ret = _krb5_principal2principalname (a->req_body.cname, creds->client);
if (ret)
goto fail;
ret = copy_Realm(&creds->client->realm, &a->req_body.realm);
if (ret)
goto fail;
} else {
krb5_realm realm;
a->req_body.cname = NULL;
ret = krb5_get_default_realm(context, &realm);
if (ret)
goto fail;
ret = copy_Realm(&realm, &a->req_body.realm);
free(realm);
}
ret = _krb5_principal2principalname (a->req_body.cname, creds->client);
if (ret)
goto fail;
ret = copy_Realm(&creds->client->realm, &a->req_body.realm);
if (ret)
goto fail;
ret = _krb5_principal2principalname (a->req_body.sname, creds->server);
if (ret)
goto fail;