diff --git a/lib/cgraph/id.c b/lib/cgraph/id.c index 694220ef39d41ff7c085892bd55436e42ec3c3c2..c37c7e590ec3840d77865a825ac56161fad132aa 100644 --- a/lib/cgraph/id.c +++ b/lib/cgraph/id.c @@ -138,7 +138,6 @@ void agfreeid(Agraph_t * g, int objtype, IDTYPE id) * Return string representation of object. * In general, returns the name of node or graph, * and the key of an edge. If edge is anonymous, returns NULL. - * Uses static buffer for anonymous graphs. */ char *agnameof(void *obj) { @@ -158,7 +157,7 @@ char *agnameof(void *obj) } if (AGTYPE(obj) != AGEDGE) { sprintf(buf, "%c%ld", LOCALNAMEPREFIX, AGID(obj)); - rv = buf; + rv = agstrdup(g, buf); } else rv = 0;