diff options
| author | Patrick Delaunay <[email protected]> | 2022-10-28 11:01:20 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-12-12 14:03:12 -0500 |
| commit | 51c5c28af59c19407d6602336ac7374dd1432c49 (patch) | |
| tree | cb1cdfba39afc3019ae499db72c91fadbdcd6b12 /boot | |
| parent | a5dacef7380e4414e7fe5831298e31122d24b18d (diff) | |
cmd: pxe: use strdup to copy config
Replace malloc and strcpy by strdup in
function parse_label_kernel.
Signed-off-by: Patrick Delaunay <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/pxe_utils.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index b59e959f715..c613818d0b3 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; |
