From 9eefb3070468d5069b1992e54a43ccf4227d81b5 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 1 Sep 2022 18:29:37 -0700 Subject: [PATCH] smyrna attr_list_new: fix unchecked allocation failures --- cmd/smyrna/gui/frmobjectui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/smyrna/gui/frmobjectui.c b/cmd/smyrna/gui/frmobjectui.c index bfbacc947..c90126402 100644 --- a/cmd/smyrna/gui/frmobjectui.c +++ b/cmd/smyrna/gui/frmobjectui.c @@ -144,10 +144,10 @@ static void free_attr_list(attr_list *l) { // that uses quicksort static attr_list *attr_list_new(Agraph_t *g, int with_widgets) { int id; - attr_list *l = malloc(sizeof(attr_list)); + attr_list *l = gv_alloc(sizeof(attr_list)); l->attr_count = 0; l->capacity = DEFAULT_ATTR_LIST_CAPACITY; - l->attributes = malloc(DEFAULT_ATTR_LIST_CAPACITY * sizeof(attr_t *)); + l->attributes = gv_calloc(DEFAULT_ATTR_LIST_CAPACITY, sizeof(attr_t*)); l->with_widgets = with_widgets; /*create filter widgets */ -- 2.50.1