From: Matthew Fernandez Date: Thu, 29 Dec 2022 21:42:03 +0000 (-0800) Subject: sparse SingleLinkedList_new_int: fix unchecked allocation failure X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64c6ae831da7084c2353ba4e60f78bb2b59c79f2;p=graphviz sparse SingleLinkedList_new_int: fix unchecked allocation failure --- 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); }