* lib/xalloc.h (x2nrealloc): Don’t change *PN until after xrealloc
succeeds, in case xalloc_die or one of its callees or longjmp
targets uses *PN. Similar code in xpalloc already does this.
+2021-03-31 Paul Eggert <eggert@cs.ucla.edu>
+
+ xalloc: delay setting size until success
+ * lib/xalloc.h (x2nrealloc): Don’t change *PN until after xrealloc
+ succeeds, in case xalloc_die or one of its callees or longjmp
+ targets uses *PN. Similar code in xpalloc already does this.
+
2021-03-28 Paul Eggert <eggert@cs.ucla.edu>
xalloc: new function xpalloc, from dfa
n += n / 2 + 1;
}
+ p = xrealloc (p, n * s);
*pn = n;
- return xrealloc (p, n * s);
+ return p;
}
/* Return a pointer to a new buffer of N bytes. This is like xmalloc,