aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/lua/executor.c3
-rw-r--r--src/nvim/marktree.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index d144a5ae23..1415ceeaed 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -821,6 +821,9 @@ void nlua_init(char **argv, int argc, int lua_arg0)
luaL_openlibs(lstate);
if (!nlua_state_init(lstate)) {
os_errmsg(_("E970: Failed to initialize builtin lua modules\n"));
+#ifdef EXITFREE
+ nlua_common_free_all_mem(lstate);
+#endif
os_exit(1);
}
diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c
index 2036ddd21d..77ba6e6fa4 100644
--- a/src/nvim/marktree.c
+++ b/src/nvim/marktree.c
@@ -1182,7 +1182,7 @@ static size_t check_node(MarkTree *b, mtnode_t *x, mtpos_t *last, bool *last_rig
assert(x->ptr[i] != x->ptr[j]);
}
}
- } else {
+ } else if (x->n > 0) {
*last = x->key[x->n - 1].pos;
}
return n_keys;