Index: main/utils.c =================================================================== --- main/utils.c (revision 357574) +++ main/utils.c (working copy) @@ -1755,8 +1755,6 @@ needed = vsnprintf(target, available, format, ap1) + 1; - va_end(ap1); - if (needed > available) { /* the allocation could not be satisfied using the field's current allocation (if it has one), or the space available in the pool (if it does not). allocate @@ -1798,8 +1796,8 @@ __ast_string_field_ptr_build_va(mgr, pool_head, ptr, format, ap1, ap2); - va_end(ap1); va_end(ap2); + va_end(ap1); } void *__ast_calloc_with_stringfields(unsigned int num_structs, size_t struct_size, size_t field_mgr_offset,