From f9c566ec1f6c7e7dac214d708826f625dff34507 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 28 Jul 2013 19:08:49 +0900 Subject: [PATCH] Fix memory leak in unittest --- tests/nghttp2_hd_test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/nghttp2_hd_test.c b/tests/nghttp2_hd_test.c index 5f3910bd..7d3d31b6 100644 --- a/tests/nghttp2_hd_test.c +++ b/tests/nghttp2_hd_test.c @@ -345,6 +345,9 @@ static void check_deflate_inflate(nghttp2_hd_context *deflater, CU_ASSERT(resnvlen == (ssize_t)nvlen); assert_nv_equal(nva, resnva, nvlen); nghttp2_hd_end_headers(inflater); + + free(resnva); + free(buf); } void test_nghttp2_hd_deflate_inflate(void) @@ -498,4 +501,7 @@ void test_nghttp2_hd_deflate_inflate(void) check_deflate_inflate(&deflater, &inflater, nv8, ARRLEN(nv8)); check_deflate_inflate(&deflater, &inflater, nv9, ARRLEN(nv9)); check_deflate_inflate(&deflater, &inflater, nv10, ARRLEN(nv10)); + + nghttp2_hd_inflate_free(&inflater); + nghttp2_hd_deflate_free(&deflater); }