From 64c6ae831da7084c2353ba4e60f78bb2b59c79f2 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 29 Dec 2022 13:42:03 -0800 Subject: [PATCH] sparse SingleLinkedList_new_int: fix unchecked allocation failure --- lib/sparse/LinkedList.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/sparse/LinkedList.c b/lib/sparse/LinkedList.c index 2d1a6b45f..6827263c3 100644 --- a/lib/sparse/LinkedList.c +++ b/lib/sparse/LinkedList.c @@ -19,8 +19,7 @@ SingleLinkedList SingleLinkedList_new(void *data){ } SingleLinkedList SingleLinkedList_new_int(int i){ - int *data; - data = malloc(sizeof(int)); + int *data = gv_alloc(sizeof(int)); data[0] = i; return SingleLinkedList_new((void*) data); } -- 2.40.0