diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-02-10 18:45:26 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-02-10 18:45:26 +0100 |
commit | d23a823669d93fb2a570a039173eefe4856ac806 (patch) | |
tree | 617130258eae70e3bd7ef7b6da9c494ffee7b572 /src/undo.c | |
parent | 42443c7d7fecc3a2a72154bb6139b028438617c2 (diff) | |
download | vim-git-d23a823669d93fb2a570a039173eefe4856ac806.tar.gz |
patch 8.0.1496: clearing a pointer takes two linesv8.0.1496
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
Diffstat (limited to 'src/undo.c')
-rw-r--r-- | src/undo.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/undo.c b/src/undo.c index 0297e3f66..c723eba6c 100644 --- a/src/undo.c +++ b/src/undo.c @@ -849,8 +849,7 @@ u_get_undo_file_name(char_u *buf_ffname, int reading) if (undo_file_name != NULL && (!reading || mch_stat((char *)undo_file_name, &st) >= 0)) break; - vim_free(undo_file_name); - undo_file_name = NULL; + VIM_CLEAR(undo_file_name); } vim_free(munged_name); @@ -3454,8 +3453,7 @@ u_clearline(void) { if (curbuf->b_u_line_ptr != NULL) { - vim_free(curbuf->b_u_line_ptr); - curbuf->b_u_line_ptr = NULL; + VIM_CLEAR(curbuf->b_u_line_ptr); curbuf->b_u_line_lnum = 0; } } |