X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fvasnprintf.c;h=8f07308781530bb94a8b474ecfa0990d354cf9a8;hb=5bddd6312f3041adf1580f0c791dcb05c0d3ae92;hp=63a9f97065d2a6f2a81e775aeab9ae6f1f1660e4;hpb=63bc47a1fecb6e16b620d95fc6f5313f317bb550;p=gnulib.git diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 63a9f9706..8f0730878 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 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)