]> granicus.if.org Git - graphviz/commitdiff
remove redundant error check in push_obj_state
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 21 Jun 2021 00:47:31 +0000 (17:47 -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/common/emit.c

index 0d799e44982fb7a2a71560b5216c4856fb7be5eb..a08b5c2869cb7ac2045c3d25cdc24862cfddf417 100644 (file)
@@ -83,8 +83,7 @@ obj_state_t* push_obj_state(GVJ_t *job)
 {
     obj_state_t *obj, *parent;
 
-    if (! (obj = zmalloc(sizeof(obj_state_t))))
-        agerr(AGERR, "no memory from zmalloc()\n");
+    obj = zmalloc(sizeof(obj_state_t));
 
     parent = obj->parent = job->obj;
     job->obj = obj;