summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-09-08 15:40:32 +0000
committerdlg <dlg@openbsd.org>2015-09-08 15:40:32 +0000
commit58b561c51f2db991f9e5fbd80fe744a5653537ff (patch)
treeb852551bb842087f0b6d63fb40534d1e3cfbd161 /lib/libkvm/kvm.c
parentRemove the default HTTPS port from tls_connect() - this is a TLS library, (diff)
downloadwireguard-openbsd-58b561c51f2db991f9e5fbd80fe744a5653537ff.tar.xz
wireguard-openbsd-58b561c51f2db991f9e5fbd80fe744a5653537ff.zip
port the changes just made to kvm_getfiles in kvm_file2.c r1.47 to
kvm_getprocs. basically cope with the number of procs growing between when we get the size and when we get the list. ok guenther@
Diffstat (limited to 'lib/libkvm/kvm.c')
-rw-r--r--lib/libkvm/kvm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c
index f784b5f013f..d9878911ef5 100644
--- a/lib/libkvm/kvm.c
+++ b/lib/libkvm/kvm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm.c,v 1.57 2015/09/04 02:58:14 dlg Exp $ */
+/* $OpenBSD: kvm.c,v 1.58 2015/09/08 15:40:32 dlg Exp $ */
/* $NetBSD: kvm.c,v 1.43 1996/05/05 04:31:59 gwr Exp $ */
/*-
@@ -184,7 +184,7 @@ _kvm_open(kvm_t *kd, const char *uf, const char *mf, const char *sf,
kd->nlfd = -1;
kd->alive = 0;
kd->filebase = NULL;
- kd->procbase = 0;
+ kd->procbase = NULL;
kd->nbpg = getpagesize();
kd->swapspc = 0;
kd->argspc = 0;
@@ -654,8 +654,7 @@ kvm_close(kvm_t *kd)
if (kd->kcore_hdr != NULL)
free((void *)kd->kcore_hdr);
free(kd->filebase);
- if (kd->procbase != 0)
- free((void *)kd->procbase);
+ free(kd->procbase);
if (kd->swapspc != 0)
free((void *)kd->swapspc);
if (kd->argspc != 0)