]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cli.c
env in ram
[z180-stamp.git] / avr / cli.c
index f0dd15410af2415701bd4ac933fe765c4345e834..be5df40deb6c2d393d59ef7799eb53b862f42940 100644 (file)
--- a/avr/cli.c
+++ b/avr/cli.c
@@ -181,9 +181,9 @@ static int cli_run_command(const char *cmd, int flag)
        if (!cmd || !*cmd)
                return -1;      /* empty command */
 
-       finaltoken = xmalloc(CONFIG_SYS_CBSIZE);
        cmdbuf = strdup(cmd);
-       if (!cmdbuf)
+       finaltoken = xmalloc(CONFIG_SYS_CBSIZE);
+       if (!finaltoken)
                return -1;      /* not enough memory */
 
        str = cmdbuf;