X-Git-Url: http://git.hcoop.net/bpt/guile.git/blobdiff_plain/d9a00aa53612b97b11847cfc03647a3ab54b2a48..49114fd43de833c0724fbb0b6dc9ca639d1ab74f:/lib/vasnprintf.c diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 13e0ebc56..cad862f9d 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2010 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -1753,8 +1753,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, return NULL; #define CLEANUP() \ - free (d.dir); \ - if (a.arg) \ + if (d.dir != d.direct_alloc_dir) \ + free (d.dir); \ + if (a.arg != a.direct_alloc_arg) \ free (a.arg); if (PRINTF_FETCHARGS (args, &a) < 0)