summaryrefslogtreecommitdiff
path: root/boot/pxe_utils.c
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2022-10-28 11:01:20 +0200
committerTom Rini <trini@konsulko.com>2022-12-12 14:03:12 -0500
commit51c5c28af59c19407d6602336ac7374dd1432c49 (patch)
treecb1cdfba39afc3019ae499db72c91fadbdcd6b12 /boot/pxe_utils.c
parenta5dacef7380e4414e7fe5831298e31122d24b18d (diff)
cmd: pxe: use strdup to copy config
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>
Diffstat (limited to 'boot/pxe_utils.c')
-rw-r--r--boot/pxe_utils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c
index b59e959f71..c613818d0b 100644
--- 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;