summaryrefslogtreecommitdiff
path: root/src/journal/test-catalog.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-18 17:37:17 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-18 19:39:09 -0500
commit06466a7f039240b4c75cd5920401a7699c263d6e (patch)
tree9491db92c04a71026fdad6408aea0f54363196ab /src/journal/test-catalog.c
parent82501b3fc40dae2660a86ab07462f33fe26347ad (diff)
journal/catalog: fix memory leaks
Various buffers were lost because finish_item() either consumed the buffer or allocated a new one (if an entry with the same key existed). The caller would simply forget the buffer in either case. Also add a check for the case when a valid identifier is followed by an empty body. We should not allow this. Also be more consistent in error handling and always print an error message.
Diffstat (limited to 'src/journal/test-catalog.c')
-rw-r--r--src/journal/test-catalog.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/journal/test-catalog.c b/src/journal/test-catalog.c
index da6fcbca4d..898c876450 100644
--- a/src/journal/test-catalog.c
+++ b/src/journal/test-catalog.c
@@ -103,6 +103,8 @@ static void test_catalog_import_one(void) {
assert_se(hashmap_size(h) == 1);
HASHMAP_FOREACH(payload, h, j) {
+ printf("expect: %s\n", expect);
+ printf("actual: %s\n", payload);
assert_se(streq(expect, payload));
}
}