]> granicus.if.org Git - graphviz/commitdiff
remove redundant error check in gvusershape_open
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 21 Jun 2021 00:50:58 +0000 (17:50 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 18:57:13 +0000 (11:57 -0700)
The zmalloc function calls exit() on failure, so there is not need to check its
return value for out-of-memory.

lib/gvc/gvusershape.c

index 3fe3ebdc6a7f1620f802d654347a0feda9ffa6d1..4476571d1060110535b3783a751a6756d00800ed 100644 (file)
@@ -663,8 +663,7 @@ static usershape_t *gvusershape_open (const char *name)
         ImageDict = dtopen(&ImageDictDisc, Dttree);
 
     if (! (us = gvusershape_find(name))) {
-        if (! (us = zmalloc(sizeof(usershape_t))))
-           return NULL;
+        us = zmalloc(sizeof(usershape_t));
 
        us->name = agstrdup (0, (char*)name);
        if (!gvusershape_file_access(us)) {