X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fvdprintf.c;h=c408e9a6015c6be33b7d24a1e4e6a75de75ae5d5;hb=0e9ef9b9c9cd7036960656c797f0567b742e7b80;hp=2b0da8a2892bd7c98acedc009dc28899c000856e;hpb=441aa3044f43e5572f58c354f01e6bc070acd5c7;p=gnulib.git diff --git a/lib/vdprintf.c b/lib/vdprintf.c index 2b0da8a28..c408e9a60 100644 --- a/lib/vdprintf.c +++ b/lib/vdprintf.c @@ -1,5 +1,5 @@ /* Formatted output to a file descriptor. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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;