]> granicus.if.org Git - graphviz/commitdiff
remove allocation failure check in setPrefix
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 15 Jun 2020 23:23:24 +0000 (16:23 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 16 Jun 2020 14:23:28 +0000 (07:23 -0700)
The function being called here, gmalloc, now exits on allocation failure. None
of setPrefix's callers can tolerate failure anyway, so this error handling seems
to have been incomplete previously.

lib/pack/ccomps.c

index 6b295298fc08cf5529cf363650501d118dfa2e52..fdc0279ec4620a908443c23239431ce1f726612a 100644 (file)
@@ -175,7 +175,7 @@ setPrefix (char* pfx, int* lenp, char* buf, int buflen)
     if (len + 25 <= buflen)
         name = buf;
     else {
-        if (!(name = (char *) gmalloc(len + 25))) return NULL;
+        name = (char *) gmalloc(len + 25);
     }
     strcpy(name, pfx);
     *lenp = len;