patch 9.0.1391: "clear" macros are not always used
Problem: "clear" macros are not always used.
Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more
places. (Yegappan Lakshmanan, closes #12104)
diff --git a/src/os_win32.c b/src/os_win32.c
index b519bf0..c43a31a 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -3764,8 +3764,7 @@
if (STRLEN(p) >= (size_t)len)
{
// long path name is too long, fall back to short one
- vim_free(p);
- p = NULL;
+ VIM_CLEAR(p);
}
}
if (p == NULL)
@@ -8073,8 +8072,7 @@
if (pNtQueryEaFile(h, &iosb, ea, eainfo.EaSize, FALSE,
NULL, 0, NULL, TRUE) != STATUS_SUCCESS)
{
- vim_free(ea);
- ea = NULL;
+ VIM_CLEAR(ea);
}
}
}