Fix segmentation fault during type initialization.

This commit is contained in:
Danila Fedorin 2018-09-13 15:08:57 -07:00
parent 5617484aff
commit 25dd70f040

View File

@ -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);
}