From 3a2893015759396e5345a1a85e0427705e0570b4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 3 Feb 2025 13:20:48 +0800 Subject: 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) https://github.com/vim/vim/commit/960dcbd098c761dd623bec9492d5391ff6e8dceb Co-authored-by: Yegappan Lakshmanan --- src/nvim/debugger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/nvim/debugger.c') diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c index f3e4ef0698..e60d04fdfd 100644 --- a/src/nvim/debugger.c +++ b/src/nvim/debugger.c @@ -110,13 +110,11 @@ void do_debug(char *cmd) } if (debug_oldval != NULL) { smsg(0, _("Oldval = \"%s\""), debug_oldval); - xfree(debug_oldval); - debug_oldval = NULL; + XFREE_CLEAR(debug_oldval); } if (debug_newval != NULL) { smsg(0, _("Newval = \"%s\""), debug_newval); - xfree(debug_newval); - debug_newval = NULL; + XFREE_CLEAR(debug_newval); } char *sname = estack_sfile(ESTACK_NONE); if (sname != NULL) { -- cgit