summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--types.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/types.c b/types.c
index e05d685..5274d23 100644
--- a/types.c
+++ b/types.c
@@ -266,7 +266,8 @@ ucv_free(uc_value_t *uv, bool retain)
ref = &closure->ref;
for (i = 0; i < function->nupvals; i++)
- ucv_put_value(&closure->upvals[i]->header, retain);
+ if (closure->upvals[i])
+ ucv_put_value(&closure->upvals[i]->header, retain);
ucv_put_value(&function->program->header, retain);
break;