diff options
author | Colin Watson <cjwatson@debian.org> | 2017-10-04 11:23:58 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-10-04 11:23:58 +0100 |
commit | 62f54f20bf351468e0124f63cc2902ee40d9b0e9 (patch) | |
tree | 3e090f2711b94ca5029d3fa3e8047b1ed1448b1f /xmalloc.c | |
parent | 6fabaf6fd9b07cc8bc6a17c9c4a5b76849cfc874 (diff) | |
parent | 66bf74a92131b7effe49fb0eefe5225151869dc5 (diff) |
Import openssh_7.6p1.orig.tar.gz
Diffstat (limited to 'xmalloc.c')
-rw-r--r-- | xmalloc.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: xmalloc.c,v 1.33 2016/02/15 09:47:49 dtucker Exp $ */ | 1 | /* $OpenBSD: xmalloc.c,v 1.34 2017/05/31 09:15:42 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -77,6 +77,18 @@ xreallocarray(void *ptr, size_t nmemb, size_t size) | |||
77 | return new_ptr; | 77 | return new_ptr; |
78 | } | 78 | } |
79 | 79 | ||
80 | void * | ||
81 | xrecallocarray(void *ptr, size_t onmemb, size_t nmemb, size_t size) | ||
82 | { | ||
83 | void *new_ptr; | ||
84 | |||
85 | new_ptr = recallocarray(ptr, onmemb, nmemb, size); | ||
86 | if (new_ptr == NULL) | ||
87 | fatal("xrecallocarray: out of memory (%zu elements of %zu bytes)", | ||
88 | nmemb, size); | ||
89 | return new_ptr; | ||
90 | } | ||
91 | |||
80 | char * | 92 | char * |
81 | xstrdup(const char *str) | 93 | xstrdup(const char *str) |
82 | { | 94 | { |