From b679a89e469b73fabd015304ebd500ae4319d16f Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 26 Jun 2021 15:58:11 -0700 Subject: [PATCH] remove unnecessary error handling in colorxlate The grealloc function can only return NULL when the passed in size is 0. That is not the case in this call site. --- lib/common/colxlate.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/common/colxlate.c b/lib/common/colxlate.c index dfa93da84..b5e8f05bc 100644 --- a/lib/common/colxlate.c +++ b/lib/common/colxlate.c @@ -315,10 +315,6 @@ int colorxlate(char *str, gvcolor_t * color, color_type_t target_type) if (len >= allocated) { allocated = len + 1 + 10; canon = grealloc(canon, allocated); - if (! canon) { - rc = COLOR_MALLOC_FAIL; - return rc; - } } q = canon; while ((c = *p++)) { -- 2.40.0