aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-01-29 19:32:01 +0300
committerZyX <kp-pav@yandex.ru>2017-03-27 00:12:42 +0300
commit295e7607c472b49e8c0762977e38c4527b746b6f (patch)
tree8c4587dd79f911ceb5a83d1553332cf7ec4f4a35 /src
parente1bbaca7acf7fc498da49081d069b00aa05506df (diff)
downloadrneovim-295e7607c472b49e8c0762977e38c4527b746b6f.tar.gz
rneovim-295e7607c472b49e8c0762977e38c4527b746b6f.tar.bz2
rneovim-295e7607c472b49e8c0762977e38c4527b746b6f.zip
executor: Fix some memory leaks
Diffstat (limited to 'src')
-rw-r--r--src/nvim/viml/executor/executor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/viml/executor/executor.c b/src/nvim/viml/executor/executor.c
index c426806b6f..df63667102 100644
--- a/src/nvim/viml/executor/executor.c
+++ b/src/nvim/viml/executor/executor.c
@@ -182,8 +182,14 @@ static int nlua_exec_luado_string(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL
if (luaL_loadbuffer(lstate, lcmd, lcmd_len, NLUA_EVAL_NAME)) {
nlua_error(lstate, _("E5109: Error while creating lua chunk: %.*s"));
+ if (lcmd_len >= IOSIZE) {
+ xfree(lcmd);
+ }
return 0;
}
+ if (lcmd_len >= IOSIZE) {
+ xfree(lcmd);
+ }
if (lua_pcall(lstate, 0, 1, 0)) {
nlua_error(lstate, _("E5110: Error while creating lua function: %.*s"));
return 0;