catch error from as.*printf

This commit is contained in:
Love Hornquist Astrand
2010-05-30 13:28:49 -07:00
parent 351e0d0914
commit 788189805c
9 changed files with 49 additions and 33 deletions

View File

@@ -67,15 +67,16 @@ static krb5_mcache *
mcc_alloc(const char *name)
{
krb5_mcache *m, *m_c;
int ret = 0;
ALLOC(m, 1);
if(m == NULL)
return NULL;
if(name == NULL)
asprintf(&m->name, "%p", m);
ret = asprintf(&m->name, "%p", m);
else
m->name = strdup(name);
if(m->name == NULL) {
if(ret < 0 || m->name == NULL) {
free(m);
return NULL;
}