Fixed stack variable used beyond its scope in boota command
diff --git a/board/ACube/common/cmd_boota.c b/board/ACube/common/cmd_boota.c
index 81af6f4..63805b2 100644
--- a/board/ACube/common/cmd_boota.c
+++ b/board/ACube/common/cmd_boota.c
@@ -291,19 +291,19 @@
env = getenv("boot1");
if(env) {
PRINTF("found: %s\n",env);
- if(is_good_bootsource(env)) argarray[argcnt++]=env;
+ if(is_good_bootsource(env)) argarray[argcnt++]=strdup(env);
}
env = getenv("boot2");
if(env) {
PRINTF("found: %s\n",env);
- if(is_good_bootsource(env)) argarray[argcnt++]=env;
+ if(is_good_bootsource(env)) argarray[argcnt++]=strdup(env);
}
env = getenv("boot3");
if(env) {
PRINTF("found: %s\n",env);
- if(is_good_bootsource(env)) argarray[argcnt++]=env;
+ if(is_good_bootsource(env)) argarray[argcnt++]=strdup(env);
}
PRINTF("First-level bootloader: got %u valid boot sources\n", argcnt);