va_copy is meant to be matched by a va_end in log_generic.
diff --git a/logging.c b/logging.c
index c4e165a..309d13c 100644
--- a/logging.c
+++ b/logging.c
@@ -105,6 +105,7 @@ static void log_generic(int prio, const char *fmt, va_list ap)
va_copy(apc, ap);
vfprintf(stderr, f, apc); /* atomic write to stderr */
+ va_end(apc);
fflush(stderr);
}