From 704f1de3d341d2a32a1fe7a47566ca009eb845e2 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 16 Sep 2022 17:40:00 -0700 Subject: [PATCH] glcomp glCompSetAddObj: fix unchecked allocation failure --- lib/glcomp/glcompset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/glcomp/glcompset.c b/lib/glcomp/glcompset.c index 88ae68b59..af65053c7 100644 --- a/lib/glcomp/glcompset.c +++ b/lib/glcomp/glcompset.c @@ -219,8 +219,8 @@ glCompSet *glCompSetNew(int w, int h) void glCompSetAddObj(glCompSet * s, glCompObj * obj) { + s->obj = gv_recalloc(s->obj, s->objcnt, s->objcnt + 1, sizeof(glCompObj*)); s->objcnt++; - s->obj = realloc(s->obj, sizeof(glCompObj *) * s->objcnt); s->obj[s->objcnt - 1] = obj; obj->common.compset = s; } -- 2.40.0