catch error from as.*printf

This commit is contained in:
Love Hornquist Astrand
2010-05-30 13:44:41 -07:00
parent 077357c848
commit 2b1645aa08
9 changed files with 50 additions and 39 deletions

View File

@@ -372,7 +372,11 @@ select_mech(OM_uint32 *minor_status, MechType *mechType, int verify_p,
*minor_status = errno;
return GSS_S_FAILURE;
}
asprintf(&str, "host@%s", hostname);
i = asprintf(&str, "host@%s", hostname);
if (i < 0 || str == NULL) {
*minor_status = ENOMEM;
return GSS_S_FAILURE;
}
host = str;
}