diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-04-24 15:39:11 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-04-24 15:39:11 +0200 |
commit | f687cf3f363cc1cbe73b61524ff8dac03aeb65a0 (patch) | |
tree | 8c4657061a98a67699f9076e7ba5db62685154ba /src/ex_getln.c | |
parent | ec38d6932c674b506484792e28b88ba43edad9ee (diff) | |
download | vim-f687cf3f363cc1cbe73b61524ff8dac03aeb65a0.zip |
updated for version 7.3.913
Problem: Still a crash when writing viminfo.
Solution: Add checks for NULL pointers. (Ron Aaron)
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 740cca204..9fdb37712 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -6177,6 +6177,7 @@ finish_viminfo_history() } vim_free(viminfo_history[type]); viminfo_history[type] = NULL; + viminfo_hisidx[type] = 0; } } @@ -6230,6 +6231,7 @@ write_viminfo_history(fp) && !(round == 2 && i >= viminfo_hisidx[type])) { p = round == 1 ? history[type][i].hisstr + : viminfo_history[type] == NULL ? NULL : viminfo_history[type][i]; if (p != NULL && (round == 2 || !history[type][i].viminfo)) { @@ -6261,7 +6263,8 @@ write_viminfo_history(fp) } } for (i = 0; i < viminfo_hisidx[type]; ++i) - vim_free(viminfo_history[type][i]); + if (viminfo_history[type] != NULL) + vim_free(viminfo_history[type][i]); vim_free(viminfo_history[type]); viminfo_history[type] = NULL; viminfo_hisidx[type] = 0; |