From 2a7998b76fd2f0bad8ed185dc48e5d3f63683353 Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 2 Jun 2014 06:56:36 +0800 Subject: [PATCH] free slug err msg --- tests/check_slug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/check_slug.c b/tests/check_slug.c index 743a53e..2107187 100644 --- a/tests/check_slug.c +++ b/tests/check_slug.c @@ -91,6 +91,7 @@ START_TEST (test_incomplete_slug) ck_assert_int_eq(cnt, 0); ck_assert(errstr); printf("%s\n",errstr); + free(errstr); } END_TEST @@ -140,14 +141,17 @@ START_TEST (test_slug_count) char * errstr = NULL; cnt = slug_count(pattern, strlen(pattern), &errstr); ck_assert_int_eq(cnt, 2); + if(errstr) free(errstr); char * pattern2 = "/user/{name:\\d{3}}/to/{id}"; cnt = slug_count(pattern2, strlen(pattern2), &errstr); ck_assert_int_eq(cnt, 2); + if(errstr) free(errstr); char * pattern3 = "/user/{name:\\d{3}}/to/{id}"; cnt = slug_count(pattern3, strlen(pattern3), &errstr); ck_assert_int_eq(cnt, 2); + if(errstr) free(errstr); } END_TEST