patch 8.1.0936: may leak memory when using 'vartabstop'
Problem: May leak memory when using 'vartabstop'. (Kuang-che Wu)
Solution: Fix handling allocated memory for 'vartabstop'. (closes #3976)
diff --git a/src/buffer.c b/src/buffer.c
index db0c591..49d38ed 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2170,9 +2170,7 @@
vim_free(buf->b_p_vsts_array);
buf->b_p_vsts_array = NULL;
clear_string_option(&buf->b_p_vts);
- if (buf->b_p_vts_array)
- vim_free(buf->b_p_vts_array);
- buf->b_p_vts_array = NULL;
+ VIM_CLEAR(buf->b_p_vts_array);
#endif
#ifdef FEAT_KEYMAP
clear_string_option(&buf->b_p_keymap);