summaryrefslogtreecommitdiff
path: root/src/quickfix.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/quickfix.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/quickfix.c')
-rw-r--r--src/quickfix.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index b2dabaaac..c3b28e4ec 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -1177,8 +1177,7 @@ qf_init_ext(
int status;
/* Do not used the cached buffer, it may have been wiped out. */
- vim_free(qf_last_bufname);
- qf_last_bufname = NULL;
+ VIM_CLEAR(qf_last_bufname);
vim_memset(&state, 0, sizeof(state));
vim_memset(&fields, 0, sizeof(fields));
@@ -1229,8 +1228,7 @@ qf_init_ext(
if (last_efm == NULL || (STRCMP(last_efm, efm) != 0))
{
/* free the previously parsed data */
- vim_free(last_efm);
- last_efm = NULL;
+ VIM_CLEAR(last_efm);
free_efm_list(&fmt_first);
/* parse the current 'efm' */
@@ -1351,8 +1349,7 @@ qf_init_end:
static void
qf_store_title(qf_info_T *qi, int qf_idx, char_u *title)
{
- vim_free(qi->qf_lists[qf_idx].qf_title);
- qi->qf_lists[qf_idx].qf_title = NULL;
+ VIM_CLEAR(qi->qf_lists[qf_idx].qf_title);
if (title != NULL)
{
@@ -3003,8 +3000,7 @@ qf_free(qf_info_T *qi, int idx)
qf_free_items(qi, idx);
- vim_free(qfl->qf_title);
- qfl->qf_title = NULL;
+ VIM_CLEAR(qfl->qf_title);
free_tv(qfl->qf_ctx);
qfl->qf_ctx = NULL;
qfl->qf_id = 0;