From 8e683affd108635c9c7ad9585086d6fff847f676 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Fri, 18 May 2012 08:45:32 +0000 Subject: Do not always grow the vector, shrink the first iovec to 0 before filling the second one --- ot_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ot_stats.c b/ot_stats.c index 010dec1..39b8d69 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -614,8 +614,8 @@ static void stats_make( int *iovec_entries, struct iovec **iovector, ot_tasktype case TASK_STATS_SLASH24S: r += stats_slash24s_txt( r, 128 ); break; case TASK_STATS_TOP10: r += stats_top_txt( r, 10 ); break; case TASK_STATS_TOP100: - if( !( r = iovec_increase( iovec_entries, iovector, 4*OT_STATS_TMPSIZE ) ) ) - return; + r = iovec_fix_increase_or_free( iovec_entries, iovector, r, 4 * OT_STATS_TMPSIZE ); + if( !r ) return; r += stats_top_txt( r, 100 ); break; case TASK_STATS_EVERYTHING: r += stats_return_everything( r ); break; #ifdef WANT_SPOT_WOODPECKER -- cgit v1.2.3