]> granicus.if.org Git - graphviz/commitdiff
remove unnecessary error handling in colorxlate
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 22:58:11 +0000 (15:58 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Jul 2021 17:45:45 +0000 (10:45 -0700)
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

index dfa93da84598f0757ef7c02c7f999c709eb61c83..b5e8f05bcb44979ea2f77fc12da322d1a6ecc3d4 100644 (file)
@@ -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++)) {