]> granicus.if.org Git - graphviz/commitdiff
smyrna new_attr_ref: fix unchecked allocation failure
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 01:29:13 +0000 (18:29 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 01:29:13 +0000 (18:29 -0700)
cmd/smyrna/gui/frmobjectui.c

index 6cedf0799c14e0ab806a5b5f8d9579c0f6837068..bfbacc94770c47fcb9c1f94c5e7b593c60dad3ff 100644 (file)
@@ -101,7 +101,7 @@ static attr_t *new_attr_with_ref(Agsym_t * sym)
 
 static attr_t *new_attr_ref(attr_t * refAttr)
 {
-    attr_t *attr = malloc(sizeof(attr_t));
+    attr_t *attr = gv_alloc(sizeof(attr_t));
     *attr = *refAttr;
     attr->defValG = safestrdup(refAttr->defValG);
     attr->defValN = safestrdup(refAttr->defValN);