*printf: Fix memory leak.
[gnulib.git] / lib / vdprintf.c
index 2b0da8a..77c8c6e 100644 (file)
@@ -54,6 +54,9 @@ vdprintf (int fd, const char *format, va_list args)
       return -1;
     }
 
+  if (output != buf)
+    free (output);
+
   if (len > INT_MAX)
     {
       errno = EOVERFLOW;