X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-common%2Fmalloc.c;h=52e0962df25a25607f221435d2f16593b5fd8222;hb=141a46406d1bbbf6676299b41f4c90ce1004eb71;hp=2c03d8fa86306c004a3b77dc75c89b652ab689b5;hpb=f61b06f15ae185410e4d5795b4fd22aeb08bbb56;p=catta diff --git a/avahi-common/malloc.c b/avahi-common/malloc.c index 2c03d8f..52e0962 100644 --- a/avahi-common/malloc.c +++ b/avahi-common/malloc.c @@ -203,8 +203,13 @@ char *avahi_strdup_vprintf(const char *fmt, va_list ap) { for (;;) { int n; char *nbuf; + va_list ap2; + + va_copy (ap2, ap); - n = vsnprintf(buf, len, fmt, ap); + n = vsnprintf(buf, len, fmt, ap2); + + va_end (ap2); if (n >= 0 && n < (int) len) return buf;