schema parsers BUGFIX memory leak
diff --git a/src/tree_schema.c b/src/tree_schema.c
index bd951b1..a53f694 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -2299,11 +2299,13 @@
retval->prev = retval;
- retval->iffeature_size = node->iffeature_size;
- retval->iffeature = calloc(retval->iffeature_size, sizeof *retval->iffeature);
- if (!retval->iffeature) {
- LOGMEM;
- goto error;
+ if (node->iffeature_size) {
+ retval->iffeature_size = node->iffeature_size;
+ retval->iffeature = calloc(retval->iffeature_size, sizeof *retval->iffeature);
+ if (!retval->iffeature) {
+ LOGMEM;
+ goto error;
+ }
}
if (!shallow) {