Merge pull request #973 from jvijtiuk/empty-leafref-path-fix

compiled schema BUGFIX when validating empty leafref path
diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index bca5669..29d238a 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -2674,6 +2674,12 @@
 
     iter = 0;
     id = leafref->path;
+
+    if (!*id) {
+        LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SYNTAX_YANG, "Empty leafref path.");
+        return LY_EVALID;
+    }
+
     while(*id && (ret = lys_path_token(&id, &prefix, &prefix_len, &name, &name_len, &parent_times, &has_predicate)) == LY_SUCCESS) {
         if (!iter) { /* first iteration */
             /* precess ".." in relative paths */