]> granicus.if.org Git - graphviz/commitdiff
remove unnecessary error handling in canontoken
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 22:56:41 +0000 (15:56 -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 6a7f1256d2f90d62b5ce44a6895165876d89fe03..dfa93da84598f0757ef7c02c7f999c709eb61c83 100644 (file)
@@ -141,8 +141,6 @@ char *canontoken(char *str)
     if (len >= allocated) {
        allocated = len + 1 + 10;
        canon = grealloc(canon, allocated);
-       if (!canon)
-           return NULL;
     }
     q = canon;
     while ((c = *p++)) {