From 61a21c6955a466a03a518ff713e61c911e34aa9a Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sat, 19 Sep 2009 14:36:06 -0700 Subject: [PATCH] catch error from vasprintf --- lib/krb5/pkinit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/krb5/pkinit.c b/lib/krb5/pkinit.c index b3e38d0a6..d8f293c4e 100644 --- a/lib/krb5/pkinit.c +++ b/lib/krb5/pkinit.c @@ -1882,11 +1882,12 @@ pk_copy_error(krb5_context context, { va_list va; char *s, *f; + int ret; va_start(va, fmt); - vasprintf(&f, fmt, va); + ret = vasprintf(&f, fmt, va); va_end(va); - if (f == NULL) { + if (ret == -1 || f == NULL) { krb5_clear_error_message(context); return; } -- 2.11.4.GIT