Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
c1b32892
Commit
c1b32892
authored
9 years ago
by
Michael McConville
Browse files
Options
Download
Email Patches
Plain Diff
Check for allocation failure
Pointed out by Michael Reed.
parent
ae5c01f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbsd/OpenBSDProcessList.c
+2
-1
openbsd/OpenBSDProcessList.c
with
2 additions
and
1 deletion
+2
-1
openbsd/OpenBSDProcessList.c
View file @
c1b32892
...
...
@@ -139,7 +139,8 @@ char *OpenBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, in
for
(
i
=
0
;
arg
[
i
]
!=
NULL
;
i
++
)
{
len
+=
strlen
(
arg
[
i
])
+
1
;
}
buf
=
s
=
malloc
(
len
);
if
((
buf
=
s
=
malloc
(
len
))
==
NULL
)
err
(
1
,
NULL
);
for
(
i
=
0
;
arg
[
i
]
!=
NULL
;
i
++
)
{
n
=
strlcpy
(
buf
,
arg
[
i
],
(
s
+
len
)
-
buf
);
buf
+=
n
;
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help