From: Lukas Slebodnik Date: Sat, 21 Jun 2014 12:59:29 +0000 (+0200) Subject: Fix error handling in k5_expand_path_tokens_extra X-Git-Tag: krb5-1.13-alpha1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44b633953c21569b3d1ceb05bda1cbb69ed4d38c;p=thirdparty%2Fkrb5.git Fix error handling in k5_expand_path_tokens_extra If strdup fails when copying extra tokens, we must terminate the argument traversal before returning. [ghudson@mit.edu: clarified commit message] --- diff --git a/src/lib/krb5/os/expand_path.c b/src/lib/krb5/os/expand_path.c index 144ccc8369..4646c54525 100644 --- a/src/lib/krb5/os/expand_path.c +++ b/src/lib/krb5/os/expand_path.c @@ -481,6 +481,7 @@ k5_expand_path_tokens_extra(krb5_context context, const char *path_in, extra_tokens[i] = strdup(va_arg(ap, const char *)); if (extra_tokens[i] == NULL) { ret = ENOMEM; + va_end(ap); goto cleanup; } }