+ void *p;
+
+ state = p = realloc(old, offsetof(struct err_state, str) + buf_size);
+ if (state) {
+ state->nstr = buf_size;
+ } else if (old) {
+ /* Failed allocation, but existing state is still good */
+ p = old;
+ } else {
+ /* Failed allocation, no existing state */
+ p = &err_no_mem;
+ }