summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-09-08 23:12:35 +0200
committerJo-Philipp Wich <jo@mein.io>2020-09-08 23:12:35 +0200
commitc1467018a6476619af4a415e09090e50f5560ff0 (patch)
treecb564f7dc31d9eaea5a1426eefc5a2c5d49e6a9b
parentda21758e6c61c52842a5d874029cff5b12941471 (diff)
ast: only invoke extended type dtor if data pointer is set
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--ast.c2
1 files changed, 1 insertions, 1 deletions
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);