summaryrefslogtreecommitdiff
path: root/xmalloc.h
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2017-05-31 09:15:42 +0000
committerDamien Miller <djm@mindrot.org>2017-06-01 14:55:22 +1000
commit9e509d4ec97cb3d71696f1a2f1fdad254cbbce11 (patch)
tree8f33ae8fa9bcfa0d9c80d0e0f1555a814a844bc1 /xmalloc.h
parentdc5dc45662773c0f7745c29cf77ae2d52723e55e (diff)
downloadopenssh-git-9e509d4ec97cb3d71696f1a2f1fdad254cbbce11.tar.gz
upstream commit
Switch to recallocarray() for a few operations. Both growth and shrinkage are handled safely, and there also is no need for preallocation dances. Future changes in this area will be less error prone. Review and one bug found by markus Upstream-ID: 822d664d6a5a1d10eccb23acdd53578a679d5065
Diffstat (limited to 'xmalloc.h')
-rw-r--r--xmalloc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmalloc.h b/xmalloc.h
index e4992893..cf38ddfa 100644
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xmalloc.h,v 1.16 2016/02/15 09:47:49 dtucker Exp $ */
+/* $OpenBSD: xmalloc.h,v 1.17 2017/05/31 09:15:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -20,6 +20,7 @@ void ssh_malloc_init(void);
void *xmalloc(size_t);
void *xcalloc(size_t, size_t);
void *xreallocarray(void *, size_t, size_t);
+void *xrecallocarray(void *, size_t, size_t, size_t);
char *xstrdup(const char *);
int xasprintf(char **, const char *, ...)
__attribute__((__format__ (printf, 2, 3)))