From 5cf454ca543126f57fc179803081f09a49351f67 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 18 Nov 2016 21:12:36 -0500 Subject: [PATCH] krb5: _krb5_expand_path_tokens missing va_end() when returning early due to memory allocation error must call va_end() Change-Id: Icc42771c166453f67679334cea19ed9be692bd87 --- lib/krb5/expand_path.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/krb5/expand_path.c b/lib/krb5/expand_path.c index 57892f2c9..765bd9dad 100644 --- a/lib/krb5/expand_path.c +++ b/lib/krb5/expand_path.c @@ -498,6 +498,7 @@ _krb5_expand_path_tokensv(krb5_context context, break; extra_tokens[i] = strdup(s); if (extra_tokens[i++] == NULL) { + va_end(ap); free_extra_tokens(extra_tokens); return krb5_enomem(context); } @@ -506,6 +507,7 @@ _krb5_expand_path_tokensv(krb5_context context, s = ""; extra_tokens[i] = strdup(s); if (extra_tokens[i] == NULL) { + va_end(ap); free_extra_tokens(extra_tokens); return krb5_enomem(context); }