0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.1507: using malloc() directly

Problem:    Using malloc() directly.
Solution:   Use ALLOC_ONE().  Remove superfluous typecast.  (Hussam al-Homsi,
            closes #6768)
This commit is contained in:
Bram Moolenaar
2020-08-22 15:19:18 +02:00
parent d70840ed68
commit 51b6eb47b3
4 changed files with 8 additions and 6 deletions

View File

@@ -4352,7 +4352,8 @@ set_ref_in_item(
}
else
{
ht_stack_T *newitem = (ht_stack_T*)malloc(sizeof(ht_stack_T));
ht_stack_T *newitem = ALLOC_ONE(ht_stack_T);
if (newitem == NULL)
abort = TRUE;
else
@@ -4378,8 +4379,8 @@ set_ref_in_item(
}
else
{
list_stack_T *newitem = (list_stack_T*)malloc(
sizeof(list_stack_T));
list_stack_T *newitem = ALLOC_ONE(list_stack_T);
if (newitem == NULL)
abort = TRUE;
else