schema compile BUGFIX memory leak
diff --git a/src/log.c b/src/log.c
index d943017..b8f9f18 100644
--- a/src/log.c
+++ b/src/log.c
@@ -269,8 +269,8 @@
 }
 
 void
-ly_log_location(const struct lysc_node *scnode, const struct lyd_node *dnode,
-        const char *path, const struct ly_in *in, uint64_t line, ly_bool reset)
+ly_log_location(const struct lysc_node *scnode, const struct lyd_node *dnode, const char *path, const struct ly_in *in,
+        uint64_t line, ly_bool reset)
 {
     if (scnode) {
         ly_set_add(&log_location.scnodes, (void *)scnode, 1, NULL);
@@ -304,8 +304,7 @@
 }
 
 void
-ly_log_location_revert(uint32_t scnode_steps, uint32_t dnode_steps,
-        uint32_t path_steps, uint32_t in_steps)
+ly_log_location_revert(uint32_t scnode_steps, uint32_t dnode_steps, uint32_t path_steps, uint32_t in_steps)
 {
     for (uint32_t i = scnode_steps; i && log_location.scnodes.count; i--) {
         log_location.scnodes.count--;
diff --git a/src/schema_compile.c b/src/schema_compile.c
index 760c052..b72d8d2 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -723,6 +723,7 @@
                         when->context, &tmp_set, LYXP_SCNODE_SCHEMA);
                 if (ret != LY_SUCCESS) {
                     LOGVAL(set->ctx, LYVE_SEMANTICS, "Invalid when condition \"%s\".", when->cond->expr);
+                    LOG_LOCBACK(1, 0, 0, 0);
                     goto cleanup;
                 }
 
@@ -736,6 +737,7 @@
                             LOGVAL(set->ctx, LYVE_SEMANTICS, "When condition cyclic dependency on the node \"%s\".",
                                     tmp_set.val.scnodes[j].scnode->name);
                             ret = LY_EVALID;
+                            LOG_LOCBACK(1, 0, 0, 0);
                             goto cleanup;
                         }