summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY.rst2
-rw-r--r--psutil/arch/bsd/openbsd.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/HISTORY.rst b/HISTORY.rst
index ee18f0e0..a80d1123 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -52,7 +52,7 @@
- 1063_: [NetBSD] net_connections() may list incorrect sockets.
- 1064_: [NetBSD] swap_memory() may segfault in case of error.
- 1065_: [OpenBSD] Process.cmdline() may raise SystemError.
-- 1067_: [NetBSD] Process.cmdline() memory leak.
+- 1067_: [NetBSD] Process.cmdline() leaks memory if proces has terminated.
**Porting notes**
diff --git a/psutil/arch/bsd/openbsd.c b/psutil/arch/bsd/openbsd.c
index 75679cf2..4caf6ed5 100644
--- a/psutil/arch/bsd/openbsd.c
+++ b/psutil/arch/bsd/openbsd.c
@@ -102,6 +102,7 @@ kinfo_getfile(long pid, int* cnt) {
}
mib[5] = (int)(len / sizeof(struct kinfo_file));
if (sysctl(mib, 6, kf, &len, NULL, 0) < 0) {
+ free(kf);
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}