diff options
author | ZyX <kp-pav@yandex.ru> | 2017-07-02 19:02:15 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-07-02 19:02:15 +0300 |
commit | 85a6329a2b73924006eaccf8fd9ab59ec5c3ec46 (patch) | |
tree | 469c41f7c163da69ecf7aa80ce480d91bcd47e0e | |
parent | df040e55fbd3edc5a36462af927a7194d079d0b8 (diff) | |
download | rneovim-85a6329a2b73924006eaccf8fd9ab59ec5c3ec46.tar.gz rneovim-85a6329a2b73924006eaccf8fd9ab59ec5c3ec46.tar.bz2 rneovim-85a6329a2b73924006eaccf8fd9ab59ec5c3ec46.zip |
eval: Use tv_dict_add_allocated_str() for mapblock_fill_dict
-rw-r--r-- | src/nvim/eval.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index c4baf3f653..32ba514d27 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12170,7 +12170,7 @@ void mapblock_fill_dict(dict_T *const dict, noremap_value = mp->m_noremap == REMAP_SCRIPT ? 2 : !!mp->m_noremap; } - tv_dict_add_str(dict, S_LEN("lhs"), lhs); + tv_dict_add_allocated_str(dict, S_LEN("lhs"), lhs); tv_dict_add_str(dict, S_LEN("rhs"), (const char *)mp->m_orig_str); tv_dict_add_nr(dict, S_LEN("noremap"), noremap_value); tv_dict_add_nr(dict, S_LEN("expr"), mp->m_expr ? 1 : 0); @@ -12178,10 +12178,7 @@ void mapblock_fill_dict(dict_T *const dict, tv_dict_add_nr(dict, S_LEN("sid"), (varnumber_T)mp->m_script_ID); tv_dict_add_nr(dict, S_LEN("buffer"), (varnumber_T)buffer_value); tv_dict_add_nr(dict, S_LEN("nowait"), mp->m_nowait ? 1 : 0); - tv_dict_add_str(dict, S_LEN("mode"), mapmode); - - xfree(lhs); - xfree(mapmode); + tv_dict_add_allocated_str(dict, S_LEN("mode"), mapmode); } /* |