From c1467018a6476619af4a415e09090e50f5560ff0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 8 Sep 2020 23:12:35 +0200 Subject: ast: only invoke extended type dtor if data pointer is set Signed-off-by: Jo-Philipp Wich --- ast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ast.c b/ast.c index 2308a09..8f5abc0 100644 --- a/ast.c +++ b/ast.c @@ -383,7 +383,7 @@ ut_extended_type_free(struct json_object *v, void *ud) et = &ut_ext_types[op->tag.type - 1]; - if (et->free) + if (et->free && op->tag.data) et->free(op->tag.data); json_object_put(op->tag.proto); -- cgit v1.2.3