(unparse_name): error check malloc properly

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6400 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-07-03 02:34:20 +00:00
parent 5a2a11f6e6
commit b68a6ee7f1

View File

@@ -254,7 +254,7 @@ unparse_name(krb5_context context,
len++;
}
*name = malloc(len);
if(*name == NULL)
if(len != 0 && *name == NULL)
return ENOMEM;
ret = unparse_name_fixed(context, principal, *name, len, short_flag);
if(ret)