check return value of alloc functions, from Charles Longeau
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21745 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -53,8 +53,12 @@ _krb5_principalname2krb5_principal (krb5_context context,
|
||||
const Realm realm)
|
||||
{
|
||||
krb5_principal p = malloc(sizeof(*p));
|
||||
if (p == NULL)
|
||||
return ENOMEM;
|
||||
copy_PrincipalName(&from, &p->name);
|
||||
p->realm = strdup(realm);
|
||||
if (p->realm == NULL)
|
||||
return ENOMEM;
|
||||
*principal = p;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user