Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
3da36bbc
Commit
3da36bbc
authored
Jan 02, 2016
by
Michael McConville
Browse files
Use dynamically allocated memory for process names
Even when they're constant, as is the case for zombie processes.
parent
c1b32892
Changes
1
Hide whitespace changes
Inline
Side-by-side
openbsd/OpenBSDProcessList.c
View file @
3da36bbc
...
...
@@ -132,9 +132,12 @@ char *OpenBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, in
arg
=
kvm_getargv
(
kd
,
kproc
,
500
);
if
(
arg
==
NULL
)
{
return
"[zombie]"
;
// the FreeBSD port uses ki_comm, but we don't have it
//return strndup(kproc->ki_comm);
if
((
s
=
strdup
(
"[zombie]"
))
==
NULL
)
{
err
(
1
,
NULL
);
}
return
s
;
}
for
(
i
=
0
;
arg
[
i
]
!=
NULL
;
i
++
)
{
len
+=
strlen
(
arg
[
i
])
+
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment