changeset 17782:cf08c2614979

lib-test: don't use 0 for old size in realloc call We have the real size, use it. Signed-off-by: Phil Carmody <phil@dovecot.fi>
author Phil Carmody <phil@dovecot.fi>
date Wed, 10 Sep 2014 14:08:58 +0300
parents f0701f84ca01
children 6848068151bf
files src/lib-test/test-common.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-test/test-common.c	Wed Sep 10 14:08:58 2014 +0300
+++ b/src/lib-test/test-common.c	Wed Sep 10 14:08:58 2014 +0300
@@ -59,7 +59,8 @@
 		/* use exactly correct buffer size so valgrind can catch
 		   read overflows */
 		if (stream->buffer_size != cur_max && cur_max > 0) {
-			stream->w_buffer = i_realloc(stream->w_buffer, 0,
+			stream->w_buffer = i_realloc(stream->w_buffer,
+						     stream->buffer_size,
 						     cur_max);
 			stream->buffer = stream->w_buffer;
 			stream->buffer_size = cur_max;