From 383196c820697409670d67f59f180300b4d6bcfa Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 23 Jun 2014 07:15:45 +0200 Subject: [PATCH] store_lookup_test: Fixed a memory leak. Thanks to Travis-CI for identifying this! I wonder why my local tests did not catch this :-( --- t/unit/core/store_lookup_test.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/t/unit/core/store_lookup_test.c b/t/unit/core/store_lookup_test.c index c125a59..e90dd06 100644 --- a/t/unit/core/store_lookup_test.c +++ b/t/unit/core/store_lookup_test.c @@ -302,16 +302,26 @@ START_TEST(test_store_cond) golden_data[i].attr, buf); for (j = 0; j < SDB_STATIC_ARRAY_LEN(tests); ++j) { - sdb_store_matcher_t *m = tests[j].matcher(c); + sdb_store_matcher_t *m; char m_str[1024]; - sdb_object_deref(SDB_OBJ(c)); + + m = tests[j].matcher(c); + fail_unless(m != NULL, + "sdb_store__matcher() = NULL; expected: "); + status = sdb_store_matcher_matches(m, obj); fail_unless(status == *tests[j].expected, "sdb_store_matcher_matches(%s) = %d; expected: %d", sdb_store_matcher_tostring(m, m_str, sizeof(m_str)), status, *tests[j].expected); + + sdb_object_deref(SDB_OBJ(m)); } + + sdb_object_deref(SDB_OBJ(c)); } + + sdb_object_deref(SDB_OBJ(obj)); } END_TEST -- 2.30.2