From 79fb3a3b8ad59021f55d80d6f9483fd72ca13d19 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 21 May 2014 18:50:45 +0800 Subject: [PATCH] check_slug: free memory --- tests/check_slug.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/check_slug.c b/tests/check_slug.c index 8b0adcd..88b11e6 100644 --- a/tests/check_slug.c +++ b/tests/check_slug.c @@ -15,16 +15,21 @@ START_TEST (test_slug_compile) { char * path = "/user/{id}"; - ck_assert_str_eq( slug_compile(path, strlen(path) ) , "/user/([^/]+)" ); + char * c = NULL; + ck_assert_str_eq( c = slug_compile(path, strlen(path) ) , "/user/([^/]+)" ); + zfree(c); char * path2 = "/what/{id}-foo"; - ck_assert_str_eq( slug_compile(path2, strlen(path2) ) , "/what/([^/]+)-foo" ); + ck_assert_str_eq( c = slug_compile(path2, strlen(path2) ) , "/what/([^/]+)-foo" ); + zfree(c); char * path3 = "-{id}"; - ck_assert_str_eq(slug_compile(path3, strlen(path3)), "-([^/]+)" ); + ck_assert_str_eq( c = slug_compile(path3, strlen(path3)), "-([^/]+)" ); + zfree(c); char * path4 = "-{idx:\\d{3}}"; - ck_assert_str_eq(slug_compile(path4, strlen(path4)), "-(\\d{3})" ); + ck_assert_str_eq( c = slug_compile(path4, strlen(path4)), "-(\\d{3})" ); + zfree(c); } END_TEST