summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-10 18:45:26 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-10 18:45:26 +0100
commitd23a823669d93fb2a570a039173eefe4856ac806 (patch)
tree617130258eae70e3bd7ef7b6da9c494ffee7b572 /src/screen.c
parent42443c7d7fecc3a2a72154bb6139b028438617c2 (diff)
downloadvim-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/screen.c')
-rw-r--r--src/screen.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/screen.c b/src/screen.c
index f365be223..ce9b6e98e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -4326,10 +4326,7 @@ win_line(
#endif
if (p_extra_free != NULL)
- {
- vim_free(p_extra_free);
- p_extra_free = NULL;
- }
+ VIM_CLEAR(p_extra_free);
/*
* Get a character from the line itself.
*/
@@ -8860,27 +8857,17 @@ give_up:
* and over again. */
done_outofmem_msg = TRUE;
}
- vim_free(new_ScreenLines);
- new_ScreenLines = NULL;
+ VIM_CLEAR(new_ScreenLines);
#ifdef FEAT_MBYTE
- vim_free(new_ScreenLinesUC);
- new_ScreenLinesUC = NULL;
+ VIM_CLEAR(new_ScreenLinesUC);
for (i = 0; i < p_mco; ++i)
- {
- vim_free(new_ScreenLinesC[i]);
- new_ScreenLinesC[i] = NULL;
- }
- vim_free(new_ScreenLines2);
- new_ScreenLines2 = NULL;
+ VIM_CLEAR(new_ScreenLinesC[i]);
+ VIM_CLEAR(new_ScreenLines2);
#endif
- vim_free(new_ScreenAttrs);
- new_ScreenAttrs = NULL;
- vim_free(new_LineOffset);
- new_LineOffset = NULL;
- vim_free(new_LineWraps);
- new_LineWraps = NULL;
- vim_free(new_TabPageIdxs);
- new_TabPageIdxs = NULL;
+ VIM_CLEAR(new_ScreenAttrs);
+ VIM_CLEAR(new_LineOffset);
+ VIM_CLEAR(new_LineWraps);
+ VIM_CLEAR(new_TabPageIdxs);
}
else
{