Fix missing va_end()s
[ccan] / ccan / failtest / failtest.c
index ab8e19cdb9caf60f1d8a9451e8225f874c7932e9..aab28dd43472449493297d223afafa21d4e667c2 100644 (file)
@@ -1085,8 +1085,8 @@ int failtest_open(const char *pathname,
        call.closed = false;
        if (call.flags & O_CREAT) {
                call.mode = va_arg(ap, int);
-               va_end(ap);
        }
+       va_end(ap);
        p = add_history(FAILTEST_OPEN, true, file, line, &call);
        /* Avoid memory leak! */
        if (p == &unrecorded_call)