From: Patrick Delaunay Date: Fri, 28 Oct 2022 09:01:20 +0000 (+0200) Subject: cmd: pxe: use strdup to copy config X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=51c5c28af59c19407d6602336ac7374dd1432c49;p=u-boot.git cmd: pxe: use strdup to copy config Replace malloc and strcpy by strdup in function parse_label_kernel. Signed-off-by: Patrick Delaunay Reviewed-by: Neil Armstrong --- 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;