libyang BUGFIX unreachable code removed
diff --git a/src/parser_lyb.c b/src/parser_lyb.c
index a17e3d3..f898085 100644
--- a/src/parser_lyb.c
+++ b/src/parser_lyb.c
@@ -1243,7 +1243,6 @@
 
     /* create the node */
     switch (value_type) {
-    case LYD_ANYDATA_LYB:
     case LYD_ANYDATA_DATATREE:
     case LYD_ANYDATA_STRING:
     case LYD_ANYDATA_XML:
diff --git a/src/tree_data.c b/src/tree_data.c
index 4b24714..fc95219 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -332,22 +332,16 @@
         rc = lyd_parse_xml_netconf(ctx, ext, parent, &first, in, parse_opts, val_opts, data_type, &envp, &parsed, &lydctx);
         if (rc && envp) {
             /* special situation when the envelopes were parsed successfully */
-            if (tree) {
-                *tree = envp;
-            } else {
-                lyd_free_all(envp);
-            }
+            *tree = envp;
             goto cleanup;
         }
 
         /* set out params correctly */
-        if (tree) {
-            if (envp) {
-                /* special out param meaning */
-                *tree = envp;
-            } else {
-                *tree = parent ? NULL : first;
-            }
+        if (envp) {
+            /* special out param meaning */
+            *tree = envp;
+        } else {
+            *tree = parent ? NULL : first;
         }
         if (op) {
             *op = lydctx->op_node;