mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
vim-patch:9.0.1391: "clear" macros are not always used (#32312)
Problem: "clear" macros are not always used.
Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more
places. (Yegappan Lakshmanan, closes vim/vim#12104)
960dcbd098
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -110,13 +110,11 @@ void do_debug(char *cmd)
|
|||||||
}
|
}
|
||||||
if (debug_oldval != NULL) {
|
if (debug_oldval != NULL) {
|
||||||
smsg(0, _("Oldval = \"%s\""), debug_oldval);
|
smsg(0, _("Oldval = \"%s\""), debug_oldval);
|
||||||
xfree(debug_oldval);
|
XFREE_CLEAR(debug_oldval);
|
||||||
debug_oldval = NULL;
|
|
||||||
}
|
}
|
||||||
if (debug_newval != NULL) {
|
if (debug_newval != NULL) {
|
||||||
smsg(0, _("Newval = \"%s\""), debug_newval);
|
smsg(0, _("Newval = \"%s\""), debug_newval);
|
||||||
xfree(debug_newval);
|
XFREE_CLEAR(debug_newval);
|
||||||
debug_newval = NULL;
|
|
||||||
}
|
}
|
||||||
char *sname = estack_sfile(ESTACK_NONE);
|
char *sname = estack_sfile(ESTACK_NONE);
|
||||||
if (sname != NULL) {
|
if (sname != NULL) {
|
||||||
|
@@ -2908,8 +2908,7 @@ void ex_function(exarg_T *eap)
|
|||||||
fudi.fd_di = tv_dict_item_alloc(fudi.fd_newkey);
|
fudi.fd_di = tv_dict_item_alloc(fudi.fd_newkey);
|
||||||
if (tv_dict_add(fudi.fd_dict, fudi.fd_di) == FAIL) {
|
if (tv_dict_add(fudi.fd_dict, fudi.fd_di) == FAIL) {
|
||||||
xfree(fudi.fd_di);
|
xfree(fudi.fd_di);
|
||||||
xfree(fp);
|
XFREE_CLEAR(fp);
|
||||||
fp = NULL;
|
|
||||||
goto erret;
|
goto erret;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -2967,8 +2966,7 @@ errret_2:
|
|||||||
XFREE_CLEAR(fp->uf_name_exp);
|
XFREE_CLEAR(fp->uf_name_exp);
|
||||||
}
|
}
|
||||||
if (free_fp) {
|
if (free_fp) {
|
||||||
xfree(fp);
|
XFREE_CLEAR(fp);
|
||||||
fp = NULL;
|
|
||||||
}
|
}
|
||||||
errret_keep:
|
errret_keep:
|
||||||
ga_clear_strings(&newargs);
|
ga_clear_strings(&newargs);
|
||||||
|
@@ -5226,7 +5226,7 @@ void buf_copy_options(buf_T *buf, int flags)
|
|||||||
// or to a help buffer.
|
// or to a help buffer.
|
||||||
if (dont_do_help) {
|
if (dont_do_help) {
|
||||||
buf->b_p_isk = save_p_isk;
|
buf->b_p_isk = save_p_isk;
|
||||||
if (p_vts && p_vts != empty_string_option && !buf->b_p_vts_array) {
|
if (p_vts && *p_vts != NUL && !buf->b_p_vts_array) {
|
||||||
tabstop_set(p_vts, &buf->b_p_vts_array);
|
tabstop_set(p_vts, &buf->b_p_vts_array);
|
||||||
} else {
|
} else {
|
||||||
buf->b_p_vts_array = NULL;
|
buf->b_p_vts_array = NULL;
|
||||||
@@ -5239,7 +5239,7 @@ void buf_copy_options(buf_T *buf, int flags)
|
|||||||
COPY_OPT_SCTX(buf, kBufOptTabstop);
|
COPY_OPT_SCTX(buf, kBufOptTabstop);
|
||||||
buf->b_p_vts = xstrdup(p_vts);
|
buf->b_p_vts = xstrdup(p_vts);
|
||||||
COPY_OPT_SCTX(buf, kBufOptVartabstop);
|
COPY_OPT_SCTX(buf, kBufOptVartabstop);
|
||||||
if (p_vts && p_vts != empty_string_option && !buf->b_p_vts_array) {
|
if (p_vts && *p_vts != NUL && !buf->b_p_vts_array) {
|
||||||
tabstop_set(p_vts, &buf->b_p_vts_array);
|
tabstop_set(p_vts, &buf->b_p_vts_array);
|
||||||
} else {
|
} else {
|
||||||
buf->b_p_vts_array = NULL;
|
buf->b_p_vts_array = NULL;
|
||||||
|
Reference in New Issue
Block a user