11305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood/* $OpenBSD: xmalloc.h,v 1.13 2006/08/03 03:34:42 deraadt Exp $ */ 21305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood 31305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood/* 41305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * Author: Tatu Ylonen <ylo@cs.hut.fi> 51305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 61305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * All rights reserved 71305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * Created: Mon Mar 20 22:09:17 1995 ylo 81305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * 91305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * Versions of malloc and friends that check their results, and never return 101305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * failure (they call fatal if they encounter an error). 111305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * 121305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * As far as I am concerned, the code I have written for this software 131305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * can be used freely for any purpose. Any derived versions of this 141305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * software must be clearly marked as such, and if the derived work is 151305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * incompatible with the protocol description in the RFC file, it must be 161305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood * called by a name other than "ssh" or "Secure Shell". 171305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood */ 181305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood 191305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwoodvoid *xmalloc(size_t); 201305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwoodvoid *xcalloc(size_t, size_t); 211305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwoodvoid *xrealloc(void *, size_t, size_t); 221305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwoodvoid xfree(void *); 231305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwoodchar *xstrdup(const char *); 241305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwoodint xasprintf(char **, const char *, ...) 251305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood __attribute__((__format__ (printf, 2, 3))) 261305e95ba6ff9fa202d0818caf10405df4b0f648Mike Lockwood __attribute__((__nonnull__ (2))); 27