aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-05-25 14:49:43 +0200
committerGitHub <noreply@github.com>2019-05-25 14:49:43 +0200
commit2f023f40b275a904c96d5b287e9e9abe6df1aec7 (patch)
tree36f2b5bec81f7144c5bd3787f33959bd60c59e0e /src/nvim/quickfix.c
parent4769deb36a54c3b2a4a2d2addb2937c1aa7dd629 (diff)
parenteddd1bff3e7bf8df7405f6b0bfd01a5bb8ba20a9 (diff)
downloadrneovim-2f023f40b275a904c96d5b287e9e9abe6df1aec7.tar.gz
rneovim-2f023f40b275a904c96d5b287e9e9abe6df1aec7.tar.bz2
rneovim-2f023f40b275a904c96d5b287e9e9abe6df1aec7.zip
Merge #10046 from justinmk/xfree
refactor: introduce XFREE_CLEAR()
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 550f742106..8036d3e3bc 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -848,8 +848,7 @@ qf_init_ext(
int status;
// Do not used the cached buffer, it may have been wiped out.
- xfree(qf_last_bufname);
- qf_last_bufname = NULL;
+ XFREE_CLEAR(qf_last_bufname);
memset(&state, 0, sizeof(state));
memset(&fields, 0, sizeof(fields));
@@ -894,8 +893,7 @@ qf_init_ext(
// parsed values.
if (last_efm == NULL || (STRCMP(last_efm, efm) != 0)) {
// free the previously parsed data
- xfree(last_efm);
- last_efm = NULL;
+ XFREE_CLEAR(last_efm);
free_efm_list(&fmt_first);
// parse the current 'efm'
@@ -1019,8 +1017,7 @@ qf_init_end:
/// Prepends ':' to the title.
static void qf_store_title(qf_info_T *qi, int qf_idx, char_u *title)
{
- xfree(qi->qf_lists[qf_idx].qf_title);
- qi->qf_lists[qf_idx].qf_title = NULL;
+ XFREE_CLEAR(qi->qf_lists[qf_idx].qf_title);
if (title != NULL) {
size_t len = STRLEN(title) + 1;
@@ -2754,8 +2751,7 @@ static void qf_free(qf_info_T *qi, int idx)
qf_list_T *qfl = &qi->qf_lists[idx];
qf_free_items(qi, idx);
- xfree(qfl->qf_title);
- qfl->qf_title = NULL;
+ XFREE_CLEAR(qfl->qf_title);
tv_free(qfl->qf_ctx);
qfl->qf_ctx = NULL;
qfl->qf_id = 0;