diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c index d93a915fd1..fb4afa5ee9 100644 --- a/tools/env/fw_env_main.c +++ b/tools/env/fw_env_main.c @@ -239,7 +239,7 @@ int main(int argc, char *argv[]) argv += optind; if (env_opts.lockname) { - lockname = malloc(sizeof(env_opts.lockname) + + lockname = malloc(strlen(env_opts.lockname) + sizeof(CMD_PRINTENV) + 10); if (!lockname) { fprintf(stderr, "Unable allocate memory");