projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5dacef
)
cmd: pxe: use strdup to copy config
author
Patrick Delaunay
<patrick.delaunay@foss.st.com>
Fri, 28 Oct 2022 09:01:20 +0000
(11:01 +0200)
committer
Tom Rini
<trini@konsulko.com>
Mon, 12 Dec 2022 19:03:12 +0000
(14:03 -0500)
Replace malloc and strcpy by strdup in
function parse_label_kernel.
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
boot/pxe_utils.c
patch
|
blob
|
history
diff --git
a/boot/pxe_utils.c
b/boot/pxe_utils.c
index
b59e959
..
c613818
100644
(file)
--- a/
boot/pxe_utils.c
+++ b/
boot/pxe_utils.c
@@
-1179,11
+1179,10
@@
static int parse_label_kernel(char **c, struct pxe_label *label)
if (!s)
return 1;
- label->config =
malloc(strlen(s) + 1
);
+ label->config =
strdup(s
);
if (!label->config)
return -ENOMEM;
- strcpy(label->config, s);
*s = 0;
return 1;