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); }