Commit b7d4a444 authored by John Ellson's avatar John Ellson

Merge branch 'master' into 'master'

agraph, agstrdup(_html)?: Fixed potential null pointer dereferences.

See merge request !1291
parents ae160d36 a0c0d580
Pipeline #36088012 canceled with stages
in 2 minutes and 21 seconds
......@@ -107,8 +107,11 @@ char *agstrdup(Agraph_t * g, char *s)
sz = sizeof(refstr_t) + strlen(s);
if (g)
r = (refstr_t *) agalloc(g, sz);
else
else {
r = (refstr_t *) malloc(sz);
if (!r)
exit(1);
}
r->refcnt = 1;
strcpy(r->store, s);
r->s = r->store;
......@@ -133,8 +136,11 @@ char *agstrdup_html(Agraph_t * g, char *s)
sz = sizeof(refstr_t) + strlen(s);
if (g)
r = (refstr_t *) agalloc(g, sz);
else
else {
r = (refstr_t *) malloc(sz);
if (!r)
exit(1);
}
r->refcnt = 1 | HTML_BIT;
strcpy(r->store, s);
r->s = r->store;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment