diff --git a/src/logging.c b/src/logging.c
index 1a4f620..12b9494 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -1141,7 +1141,7 @@ void
 _gpgrt_log_printhex (const void *buffer, size_t length,
                      const char *fmt, ...)
 {
-  va_list arg_ptr;
+  va_list arg_ptr = {};
 
   if (fmt)
     {
@@ -1150,7 +1150,7 @@ _gpgrt_log_printhex (const void *buffer, size_t length,
       va_end (arg_ptr);
     }
   else
-    _gpgrt_logv_printhex (buffer, length, NULL, NULL);
+    _gpgrt_logv_printhex (buffer, length, NULL, arg_ptr);
 }
 
 
