mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
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>
This commit is contained in:
committed by
Tom Rini
parent
a5dacef738
commit
51c5c28af5
@@ -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;
|
||||
|
Reference in New Issue
Block a user