]> granicus.if.org Git - graphviz/commitdiff
Fix use of ZALLOC macro.
authorerg <devnull@localhost>
Mon, 25 Jun 2007 17:49:46 +0000 (17:49 +0000)
committererg <devnull@localhost>
Mon, 25 Jun 2007 17:49:46 +0000 (17:49 +0000)
lib/common/labels.c

index 44b41d32429c86415c37e9fce79b3821ccbcc807..5ea09e2f957fc7dc3279cf7c3b0a16971ed6aa1c 100644 (file)
@@ -23,9 +23,9 @@ static void storeline(graph_t *g, textlabel_t *lp, char *line, char terminator)
 {
     pointf size;
     textpara_t *para;
+    int oldsz = lp->u.txt.nparas + 1;
 
-    lp->u.txt.para =
-       ZALLOC(lp->u.txt.nparas + 2, lp->u.txt.para, textpara_t);
+    lp->u.txt.para = ZALLOC(oldsz + 1, lp->u.txt.para, textpara_t, oldsz);
     para = &(lp->u.txt.para[lp->u.txt.nparas]);
     para->str = line;
     para->just = terminator;