File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2465,6 +2465,10 @@ int cli_int_execute_buildmode(struct cli_def *cli) {
24652465 char * value = NULL ;
24662466
24672467 cmdline = strdup (cli_command_name (cli , cli -> buildmode -> command ));
2468+ if (!cmdline ) {
2469+ cli_error (cli , "Unable to allocate memory to process buildmode commandline" );
2470+ rc = CLI_ERROR ;
2471+ }
24682472 for (optarg = cli -> buildmode -> command -> optargs ; rc == CLI_OK && optarg ; optarg = optarg -> next ) {
24692473 value = NULL ;
24702474 do {
@@ -2480,16 +2484,16 @@ int cli_int_execute_buildmode(struct cli_def *cli) {
24802484 } else if (value ) {
24812485 if (optarg -> flags & (CLI_CMD_OPTIONAL_FLAG | CLI_CMD_ARGUMENT )) {
24822486 if (!(cmdline = cli_int_buildmode_extend_cmdline (cmdline , value ))) {
2483- cli_error (cli , "Unable to append to building commandlne " );
2487+ cli_error (cli , "Unable to allocate memory to process buildmode commandline " );
24842488 rc = CLI_ERROR ;
24852489 }
24862490 } else {
24872491 if (!(cmdline = cli_int_buildmode_extend_cmdline (cmdline , optarg -> name ))) {
2488- cli_error (cli , "Unable to append to building commandlne " );
2492+ cli_error (cli , "Unable to allocate memory to process buildmode commandline " );
24892493 rc = CLI_ERROR ;
24902494 }
24912495 if (!(cmdline = cli_int_buildmode_extend_cmdline (cmdline , value ))) {
2492- cli_error (cli , "Unable to append to building commandlne " );
2496+ cli_error (cli , "Unable to allocate memory to process buildmode commandline " );
24932497 rc = CLI_ERROR ;
24942498 }
24952499 }
You can’t perform that action at this time.
0 commit comments