Fixed use of uninitialized deflater

This commit is contained in:
Tatsuhiro Tsujikawa 2012-03-01 22:40:09 +09:00
parent a9d9126229
commit 7bea01d0ce
1 changed files with 3 additions and 3 deletions

View File

@ -50,12 +50,12 @@ void test_spdylay_zlib_with(uint16_t version)
ssize_t deflatebuf_len;
spdylay_buffer_init(&buf, 4096);
deflatebuf_max = spdylay_zlib_deflate_hd_bound(&deflater, sizeof(msg));
deflatebuf = malloc(deflatebuf_max);
CU_ASSERT(0 == spdylay_zlib_deflate_hd_init(&deflater, version));
CU_ASSERT(0 == spdylay_zlib_inflate_hd_init(&inflater, version));
deflatebuf_max = spdylay_zlib_deflate_hd_bound(&deflater, sizeof(msg));
deflatebuf = malloc(deflatebuf_max);
CU_ASSERT(0 < (deflatebuf_len = spdylay_zlib_deflate_hd
(&deflater, deflatebuf, deflatebuf_max,
(const uint8_t*)msg, sizeof(msg))));