From: Matthew Fernandez Date: Tue, 16 Jun 2020 00:55:46 +0000 (-0700) Subject: refactor a RALLOC call that can tolerate failure to realloc X-Git-Tag: 2.44.1~5^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b209f9cbc2dd1171f4c065b7ae9b35db7c4b13e3;p=graphviz refactor a RALLOC call that can tolerate failure to realloc We are about to make the RALLOC wrapper exit on allocation failure, so this preserves the semantics of this call which handles allocation failure locally. --- diff --git a/lib/common/routespl.c b/lib/common/routespl.c index 1acdf6aa4..89a3c2aaf 100644 --- a/lib/common/routespl.c +++ b/lib/common/routespl.c @@ -847,7 +847,7 @@ static int mkspacep(int size) { if (size > maxpn) { int newmax = maxpn + (size / PINC + 1) * PINC; - ps = RALLOC(newmax, ps, pointf); + ps = realloc(ps, newmax * sizeof(pointf)); if (!ps) { agerr(AGERR, "cannot re-allocate ps\n"); return 1;