]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-test: don't use 0 for old size in realloc call
authorPhil Carmody <phil@dovecot.fi>
Wed, 10 Sep 2014 11:08:58 +0000 (14:08 +0300)
committerPhil Carmody <phil@dovecot.fi>
Wed, 10 Sep 2014 11:08:58 +0000 (14:08 +0300)
We have the real size, use it.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
src/lib-test/test-common.c

index af055a8401d94e002a8766d70b1090f92b510cb4..ad1badef16aca1b266e37e53f4835f3f1fff3a65 100644 (file)
@@ -59,7 +59,8 @@ static ssize_t test_read(struct istream_private *stream)
                /* 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;