From: Matthew Fernandez Date: Mon, 21 Jun 2021 00:50:58 +0000 (-0700) Subject: remove redundant error check in gvusershape_open X-Git-Tag: 2.48.0~29^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9abed2b06e82abf7e4353342373ebde36cd748d2;p=graphviz remove redundant error check in gvusershape_open The zmalloc function calls exit() on failure, so there is not need to check its return value for out-of-memory. --- diff --git a/lib/gvc/gvusershape.c b/lib/gvc/gvusershape.c index 3fe3ebdc6..4476571d1 100644 --- a/lib/gvc/gvusershape.c +++ b/lib/gvc/gvusershape.c @@ -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)) {