]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix error handling in k5_expand_path_tokens_extra
authorLukas Slebodnik <lslebodn@redhat.com>
Sat, 21 Jun 2014 12:59:29 +0000 (14:59 +0200)
committerGreg Hudson <ghudson@mit.edu>
Sat, 12 Jul 2014 17:35:46 +0000 (13:35 -0400)
If strdup fails when copying extra tokens, we must terminate the
argument traversal before returning.

[ghudson@mit.edu: clarified commit message]

src/lib/krb5/os/expand_path.c

index 144ccc8369a53254a0a65819cbd91b448d4adf2b..4646c545257a3eeb67d39e7ed26f393e8a52992c 100644 (file)
@@ -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;
             }
         }