Commit: patch 9.1.1225: extra NULL check in VIM_CLEAR()

0 views
Skip to first unread message

Christian Brabandt

unread,
Mar 19, 2025, 3:30:18 PM3/19/25
to vim...@googlegroups.com
patch 9.1.1225: extra NULL check in VIM_CLEAR()

Commit: https://github.com/vim/vim/commit/e4e0a2468c78f67ea5ba356d71f2f1983b53b1c4
Author: Hirohito Higashi <h.eas...@gmail.com>
Date: Wed Mar 19 20:25:21 2025 +0100

patch 9.1.1225: extra NULL check in VIM_CLEAR()

Problem: extra NULL check in VIM_CLEAR()
Solution: remove the NULL check and rely on the NULL check in vim_free()
instead (Hirohito Higashi).

closes: #16936

Signed-off-by: Hirohito Higashi <h.eas...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/macros.h b/src/macros.h
index 86ae33b4a..6c2931a29 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -360,11 +360,8 @@
*/
#define VIM_CLEAR(p) \
do { \
- if ((p) != NULL) \
- { \
- vim_free(p); \
- (p) = NULL; \
- } \
+ vim_free(p); \
+ (p) = NULL; \
} while (0)

/*
diff --git a/src/version.c b/src/version.c
index 02f30abf3..aab2ea560 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1225,
/**/
1224,
/**/
Reply all
Reply to author
Forward
0 new messages