From 227639cdd9e61a42c1b7f84a79fc7e431cb5a858 Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Thu, 8 Dec 2022 15:43:51 +0100 Subject: util/sconfig: Remove unnecessary strdup() calls getopt() optarg value can be used without duplicaing if it is not modified, as it is the case here. Signed-off-by: Jakub Czapiga Change-Id: Ie5a27f64077af1c04b06732cd601145b8becacfd Reviewed-on: https://review.coreboot.org/c/coreboot/+/70525 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- util/sconfig/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'util/sconfig') diff --git a/util/sconfig/main.c b/util/sconfig/main.c index 04f78a406e..3f12946edf 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -1971,25 +1971,25 @@ int main(int argc, char **argv) &option_index)) != EOF) { switch (opt) { case 'm': - base_devtree = strdup(optarg); + base_devtree = optarg; break; case 'o': - override_devtree = strdup(optarg); + override_devtree = optarg; break; case 'p': - chipset_devtree = strdup(optarg); + chipset_devtree = optarg; break; case 'c': - outputc = strdup(optarg); + outputc = optarg; break; case 'r': - outputh = strdup(optarg); + outputh = optarg; break; case 'd': - outputd = strdup(optarg); + outputd = optarg; break; case 'f': - outputf = strdup(optarg); + outputf = optarg; break; case 'h': default: -- cgit v1.2.3