libyang BUGFIX uninitialized variables

reported by coverity
diff --git a/src/xpath.c b/src/xpath.c
index b14ee8c..4160656 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -6999,6 +6999,8 @@
                     && (!scnode || (lysc_data_parent(scnode) != set->val.nodes[i].node->schema))) {
                 /* do not repeat the same search */
                 tmp = lys_find_child(set->val.nodes[i].node->schema, moveto_mod, ncname, ncname_len, 0, 0);
+            } else {
+                tmp = NULL;
             }
 
             /* additional context check */
@@ -7015,7 +7017,6 @@
                     /* remember the found schema node and continue to make sure it can be used */
                     scnode = tmp;
                 }
-                tmp = NULL;
             }
         }