diff options
-rw-r--r-- | lib/libkvm/kvm.c | 10 | ||||
-rw-r--r-- | lib/libkvm/kvm_private.h | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index ee97c433b16..a261ce4ff82 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm.c,v 1.55 2015/05/11 00:42:54 guenther Exp $ */ +/* $OpenBSD: kvm.c,v 1.56 2015/09/04 02:55:09 dlg Exp $ */ /* $NetBSD: kvm.c,v 1.43 1996/05/05 04:31:59 gwr Exp $ */ /*- @@ -163,6 +163,14 @@ _kvm_malloc(kvm_t *kd, size_t n) return (p); } +void * +_kvm_realloc(kvm_t *kd, void *p, size_t n) +{ + if ((p = realloc(p, n)) == NULL) + _kvm_err(kd, kd->program, "%s", strerror(errno)); + return (p); +} + static kvm_t * _kvm_open(kvm_t *kd, const char *uf, const char *mf, const char *sf, int flag, char *errout) diff --git a/lib/libkvm/kvm_private.h b/lib/libkvm/kvm_private.h index e11501aaf7b..b42634ba969 100644 --- a/lib/libkvm/kvm_private.h +++ b/lib/libkvm/kvm_private.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_private.h,v 1.23 2014/10/15 02:03:05 deraadt Exp $ */ +/* $OpenBSD: kvm_private.h,v 1.24 2015/09/04 02:55:09 dlg Exp $ */ /* $NetBSD: kvm_private.h,v 1.7 1996/05/05 04:32:15 gwr Exp $ */ /*- @@ -98,6 +98,7 @@ void _kvm_freevtop(kvm_t *); int _kvm_initvtop(kvm_t *); int _kvm_kvatop(kvm_t *, u_long, paddr_t *); void *_kvm_malloc(kvm_t *kd, size_t); +void *_kvm_realloc(kvm_t *kd, void *, size_t); off_t _kvm_pa2off(kvm_t *, paddr_t); void *_kvm_reallocarray(kvm_t *kd, void *, size_t, size_t); void _kvm_syserr(kvm_t *kd, const char *program, const char *fmt, ...) |