=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/xmalloc.c,v retrieving revision 1.12 retrieving revision 1.13 diff -c -r1.12 -r1.13 *** src/usr.bin/tmux/xmalloc.c 2019/06/28 05:44:09 1.12 --- src/usr.bin/tmux/xmalloc.c 2019/11/28 09:51:58 1.13 *************** *** 1,4 **** ! /* $OpenBSD: xmalloc.c,v 1.12 2019/06/28 05:44:09 deraadt Exp $ */ /* * Author: Tatu Ylonen --- 1,4 ---- ! /* $OpenBSD: xmalloc.c,v 1.13 2019/11/28 09:51:58 nicm Exp $ */ /* * Author: Tatu Ylonen *************** *** 67,72 **** --- 67,86 ---- new_ptr = reallocarray(ptr, nmemb, size); if (new_ptr == NULL) fatalx("xreallocarray: allocating %zu * %zu bytes: %s", + nmemb, size, strerror(errno)); + return new_ptr; + } + + void * + xrecallocarray(void *ptr, size_t oldnmemb, size_t nmemb, size_t size) + { + void *new_ptr; + + if (nmemb == 0 || size == 0) + fatalx("xrecallocarray: zero size"); + new_ptr = recallocarray(ptr, oldnmemb, nmemb, size); + if (new_ptr == NULL) + fatalx("xrecallocarray: allocating %zu * %zu bytes: %s", nmemb, size, strerror(errno)); return new_ptr; }