From 25dd70f040192785fe490f3b53807d1b921c9aec Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 13 Sep 2018 15:08:57 -0700 Subject: [PATCH] Fix segmentation fault during type initialization. --- src/parsetype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parsetype.c b/src/parsetype.c index 55a3c2d..92ca70b 100644 --- a/src/parsetype.c +++ b/src/parsetype.c @@ -45,7 +45,7 @@ libab_result libab_parsetype_init_va(libab_parsetype* type, result = libab_ref_vec_insert(&type->children, ref); } - if (free_vec) { + if (result != LIBAB_SUCCESS && free_vec) { libab_ref_vec_free(&type->children); }