summaryrefslogtreecommitdiff
path: root/lib/dprintf.c
diff options
context:
space:
mode:
authorJoel E. Denny <jdenny@clemson.edu>2009-12-15 10:07:39 +0100
committerBruno Haible <bruno@clisp.org>2009-12-15 10:18:30 +0100
commit2c0087ea00a28c65a7b118aaa00e768dcf5886ad (patch)
treeacb36819524e99625628fc1685ba5eb603e46bae /lib/dprintf.c
parent25552e29ba625a744cabd0978bdc2349b909b671 (diff)
downloadgnulib-2c0087ea00a28c65a7b118aaa00e768dcf5886ad.tar.gz
*printf: Fix memory leak.
Diffstat (limited to 'lib/dprintf.c')
-rw-r--r--lib/dprintf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/dprintf.c b/lib/dprintf.c
index 70f992f0e5..99ee6af7f3 100644
--- a/lib/dprintf.c
+++ b/lib/dprintf.c
@@ -57,6 +57,9 @@ dprintf (int fd, const char *format, ...)
return -1;
}
+ if (output != buf)
+ free (output);
+
if (len > INT_MAX)
{
errno = EOVERFLOW;