dovecot-2.2: lib-test: don't use 0 for old size in realloc call

dovecot at dovecot.org dovecot at dovecot.org
Wed Sep 10 11:12:06 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/cf08c2614979
changeset: 17782:cf08c2614979
user:      Phil Carmody <phil at dovecot.fi>
date:      Wed Sep 10 14:08:58 2014 +0300
description:
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 at dovecot.fi>

diffstat:

 src/lib-test/test-common.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r f0701f84ca01 -r cf08c2614979 src/lib-test/test-common.c
--- 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;


More information about the dovecot-cvs mailing list