catch error from as.*printf

This commit is contained in:
Love Hornquist Astrand
2010-05-30 13:37:07 -07:00
parent 788189805c
commit 077357c848
6 changed files with 23 additions and 16 deletions

View File

@@ -77,7 +77,8 @@ test_princ(krb5_context context)
realm = krb5_principal_get_realm(context, p);
asprintf(&princ_reformed, "%s@%s", princ_short, realm);
if (asprintf(&princ_reformed, "%s@%s", princ_short, realm) < 0 || princ_reformed == NULL)
errx(1, "malloc");
ret = krb5_parse_name(context, princ_reformed, &p2);
free(princ_reformed);