libyang BUGFIX do not overwrite temp log opts
diff --git a/src/tree_data_new.c b/src/tree_data_new.c
index e56e61e..e7f5f61 100644
--- a/src/tree_data_new.c
+++ b/src/tree_data_new.c
@@ -263,7 +263,7 @@
 {
     LY_ERR rc = LY_SUCCESS;
     struct lyd_ctx *lydctx = NULL;
-    uint32_t parse_opts, int_opts, log_opts = 0;
+    uint32_t parse_opts, int_opts, *prev_lo, temp_lo = 0;
 
     *tree = NULL;
 
@@ -273,7 +273,7 @@
 
     if (!log) {
         /* no logging */
-        ly_temp_log_options(&log_opts);
+        prev_lo = ly_temp_log_options(&temp_lo);
     }
 
     switch (value_type) {
@@ -297,7 +297,7 @@
 
     if (!log) {
         /* restore logging */
-        ly_temp_log_options(NULL);
+        ly_temp_log_options(prev_lo);
     }
     if (rc && *tree) {
         lyd_free_siblings(*tree);