X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fdprintf.c;h=d325eddd5917148fb3adb5b227cdd65bd70c716f;hb=4779b635ef35c7b0bc4044fcb5bc746d06f158c4;hp=70f992f0e5420061eced5db60dcd9f7c83aa78b9;hpb=441aa3044f43e5572f58c354f01e6bc070acd5c7;p=gnulib.git diff --git a/lib/dprintf.c b/lib/dprintf.c index 70f992f0e..d325eddd5 100644 --- a/lib/dprintf.c +++ b/lib/dprintf.c @@ -1,5 +1,5 @@ /* Formatted output to a file descriptor. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2013 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 @@ -57,6 +57,9 @@ dprintf (int fd, const char *format, ...) return -1; } + if (output != buf) + free (output); + if (len > INT_MAX) { errno = EOVERFLOW;