aboutsummaryrefslogtreecommitdiffstats
path: root/src/describe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/describe.c')
-rw-r--r--src/describe.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/describe.c b/src/describe.c
index 695217fd..92750363 100644
--- a/src/describe.c
+++ b/src/describe.c
@@ -23,6 +23,7 @@
#define ZIX_HASH_RECORD_TYPE const SerdNode
#include "serd/serd.h"
+#include "zix/allocator.h"
#include "zix/common.h"
#include "zix/digest.h"
#include "zix/hash.h"
@@ -295,16 +296,18 @@ serd_describe_range(const SerdCursor* const range,
assert(sink);
- SerdStatus st = SERD_SUCCESS;
- SerdCursor copy = *range;
- ZixHash* const list_subjects =
- zix_hash_new(NULL, identity, ptr_hash, ptr_equals);
+ SerdCursor copy = *range;
- DescribeContext ctx = {range->model, sink, list_subjects, flags};
+ ZixHash* const list_subjects = zix_hash_new(
+ (ZixAllocator*)range->model->allocator, identity, ptr_hash, ptr_equals);
- st = write_pretty_range(&ctx, 0, &copy, NULL, (flags & SERD_NO_TYPE_FIRST));
+ SerdStatus st = SERD_BAD_ALLOC;
+ if (list_subjects) {
+ DescribeContext ctx = {range->model, sink, list_subjects, flags};
- zix_hash_free(list_subjects);
+ st = write_pretty_range(&ctx, 0, &copy, NULL, (flags & SERD_NO_TYPE_FIRST));
+ }
+ zix_hash_free(list_subjects);
return st;
}