pool: Support null 'pool' argument in pool_vasprintf().
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 11 Nov 2022 17:40:33 +0000 (09:40 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 17 Nov 2022 22:44:37 +0000 (14:44 -0800)
Other similar functions support a null 'pool', so this function should too.

src/libpspp/pool.c

index 377ca9d853a44ca900e02da8bc1e1ac6da5cccab..a1979abc81b5d68b5916b56c590c6dcfd3f94580 100644 (file)
@@ -395,6 +395,9 @@ pool_memdup0 (struct pool *pool, const char *string, size_t size)
 char *
 pool_vasprintf (struct pool *pool, const char *format, va_list args_)
 {
+  if (!pool)
+    return xvasprintf (format, args_);
+
   struct pool_block *b;
   va_list args;
   int needed, avail;