patch 8.2.1507: using malloc() directly
Problem: Using malloc() directly.
Solution: Use ALLOC_ONE(). Remove superfluous typecast. (Hussam al-Homsi,
closes #6768)
diff --git a/src/eval.c b/src/eval.c
index cc044a4..4b1e0f1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -4352,7 +4352,8 @@
}
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 @@
}
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