1*4f52dfbbSDag-Erling Smørgrav /* $OpenBSD: xmalloc.h,v 1.17 2017/05/31 09:15:42 deraadt Exp $ */ 2ae1f160dSDag-Erling Smørgrav 3511b41d2SMark Murray /* 4511b41d2SMark Murray * Author: Tatu Ylonen <ylo@cs.hut.fi> 5511b41d2SMark Murray * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 6511b41d2SMark Murray * All rights reserved 7511b41d2SMark Murray * Created: Mon Mar 20 22:09:17 1995 ylo 8511b41d2SMark Murray * 9511b41d2SMark Murray * Versions of malloc and friends that check their results, and never return 10511b41d2SMark Murray * failure (they call fatal if they encounter an error). 11511b41d2SMark Murray * 12b66f2d16SKris Kennaway * As far as I am concerned, the code I have written for this software 13b66f2d16SKris Kennaway * can be used freely for any purpose. Any derived versions of this 14b66f2d16SKris Kennaway * software must be clearly marked as such, and if the derived work is 15b66f2d16SKris Kennaway * incompatible with the protocol description in the RFC file, it must be 16b66f2d16SKris Kennaway * called by a name other than "ssh" or "Secure Shell". 17511b41d2SMark Murray */ 18511b41d2SMark Murray 19acc1a9efSDag-Erling Smørgrav void ssh_malloc_init(void); 20ae1f160dSDag-Erling Smørgrav void *xmalloc(size_t); 21761efaa7SDag-Erling Smørgrav void *xcalloc(size_t, size_t); 22557f75e5SDag-Erling Smørgrav void *xreallocarray(void *, size_t, size_t); 23*4f52dfbbSDag-Erling Smørgrav void *xrecallocarray(void *, size_t, size_t, size_t); 24ae1f160dSDag-Erling Smørgrav char *xstrdup(const char *); 25761efaa7SDag-Erling Smørgrav int xasprintf(char **, const char *, ...) 26761efaa7SDag-Erling Smørgrav __attribute__((__format__ (printf, 2, 3))) 27761efaa7SDag-Erling Smørgrav __attribute__((__nonnull__ (2))); 28