diff options
| author | Jurica Bradaric <jbradaric@gmail.com> | 2016-09-18 17:43:15 +0200 |
|---|---|---|
| committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-09-28 21:36:11 +0200 |
| commit | 75314101691a86575fb7d7b1b2931a5dfe7e14e2 (patch) | |
| tree | 0ebcd0a4b5c1b9af17cf6e95376b008bc2632e64 /src/nvim/eval.c | |
| parent | 42731a9a154c991706b8b5816fbdf5d31726cd97 (diff) | |
| download | rneovim-75314101691a86575fb7d7b1b2931a5dfe7e14e2.tar.gz rneovim-75314101691a86575fb7d7b1b2931a5dfe7e14e2.tar.bz2 rneovim-75314101691a86575fb7d7b1b2931a5dfe7e14e2.zip | |
vim-patch:7.4.1679
Problem: Coverity: copying value of v_lock without initializing it.
Solution: Init v_lock in rettv_list_alloc() and rettv_dict_alloc().
https://github.com/vim/vim/commit/7d2a5796d39905a972e8f74af5f7b0a62e3de173
Diffstat (limited to 'src/nvim/eval.c')
| -rw-r--r-- | src/nvim/eval.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 045ca22e16..5c6c66ade1 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -4951,7 +4951,8 @@ static list_T *rettv_list_alloc(typval_T *rettv) list_T *l = list_alloc(); rettv->vval.v_list = l; rettv->v_type = VAR_LIST; - ++l->lv_refcount; + rettv->v_lock = VAR_UNLOCKED; + l->lv_refcount++; return l; } @@ -6131,7 +6132,8 @@ static void rettv_dict_alloc(typval_T *rettv) rettv->vval.v_dict = d; rettv->v_type = VAR_DICT; - ++d->dv_refcount; + rettv->v_lock = VAR_UNLOCKED; + d->dv_refcount++; } /// Clear all the keys of a Dictionary. "d" remains a valid empty Dictionary. |