From: Sebastian Harl Date: Mon, 23 Jun 2014 05:15:45 +0000 (+0200) Subject: store_lookup_test: Fixed a memory leak. X-Git-Tag: sysdb-0.2.0~40 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=383196c820697409670d67f59f180300b4d6bcfa;p=sysdb.git store_lookup_test: Fixed a memory leak. Thanks to Travis-CI for identifying this! I wonder why my local tests did not catch this :-( --- 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