From 41fae58ecd8d0099ce2802f43e6b998eecc818c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Mon, 18 Nov 2019 04:10:06 -0500 Subject: [PATCH] zipl: drop redundant string duplication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub-ID: #76 Signed-off-by: Dan Horák Signed-off-by: Stefan Haberland Signed-off-by: Jan Höppner --- zipl/src/scan.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/zipl/src/scan.c b/zipl/src/scan.c index 38fa5454..0ea37efa 100644 --- a/zipl/src/scan.c +++ b/zipl/src/scan.c @@ -1575,7 +1575,6 @@ scan_check_bls(struct scan_token *scan) int i, rc; char *target_value = NULL; char *img_value = NULL; - char *buffer = NULL; /* * In the BLS case, each BLS section heading inherits a keyword * assignment target= from zipl.conf, and they are all the same. @@ -1609,14 +1608,8 @@ scan_check_bls(struct scan_token *scan) scan[i].content.keyword.value); return rc; } - buffer = (char *) - misc_malloc(strlen(img_value) + 1); - if (buffer == NULL) - return -1; - memcpy(buffer, img_value, strlen(img_value)); - buffer[strlen(img_value)] = 0; free(scan[i].content.keyword.value); - scan[i].content.keyword.value = buffer; + scan[i].content.keyword.value = img_value; } } }