diff options
author | peter <peter@FreeBSD.org> | 1995-12-09 04:45:50 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-12-09 04:45:50 +0000 |
commit | 109e4a7676811ce16d6a57e11b5880c7c9141d0f (patch) | |
tree | 19030bfb06de62c9f3a9bc7071d263834b9312ec /lib/libkvm | |
parent | 2e32505a556a745cfb1b3072490b507b550da5fa (diff) | |
download | FreeBSD-src-109e4a7676811ce16d6a57e11b5880c7c9141d0f.zip FreeBSD-src-109e4a7676811ce16d6a57e11b5880c7c9141d0f.tar.gz |
phkmalloc strikes again! :-) Another use of un-cleared returns from
malloc squashed...
Diffstat (limited to 'lib/libkvm')
-rw-r--r-- | lib/libkvm/kvm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 753d06a..3c95b85 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -157,6 +157,7 @@ _kvm_malloc(kd, n) if ((p = malloc(n)) == NULL) _kvm_err(kd, kd->program, strerror(errno)); + memset(p, 0, n); return (p); } @@ -275,6 +276,7 @@ kvm_openfiles(uf, mf, sf, flag, errout) (void)strcpy(errout, strerror(errno)); return (0); } + memset(kd, 0, sizeof(*kd)); kd->program = 0; return (_kvm_open(kd, uf, mf, sf, flag, errout)); } @@ -295,6 +297,7 @@ kvm_open(uf, mf, sf, flag, errstr) errstr, strerror(errno)); return (0); } + memset(kd, 0, sizeof(*kd)); kd->program = errstr; return (_kvm_open(kd, uf, mf, sf, flag, NULL)); } |