From d85c9728fb4719c972e51781230fab120d26dc5f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 11 May 2024 21:59:48 +0200 Subject: [PATCH] command: no need to duplicate const mem No need to duplicate const char* here as we refer already constant string in .rodata segment. --- tools/command.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/command.c b/tools/command.c index 7778620a7..eb7c5993a 100644 --- a/tools/command.c +++ b/tools/command.c @@ -1341,13 +1341,7 @@ int define_commands(struct cmd_context *cmdtool, const char *run_name) cmd = &commands[cmd_count]; cmd->command_index = cmd_count; cmd_count++; - cmd->name = dm_pool_strdup(cmdtool->libmem, name); - - if (!cmd->name) { - /* FIXME */ - stack; - return 0; - } + cmd->name = name; if (run_name && strcmp(run_name, name)) { skip = 1;