ui/devcmd.c: move free(path) after usage

This commit is contained in:
zcsahok 2016-04-20 17:44:21 +02:00
parent 0513b770de
commit 1bfb30ab59
1 changed files with 2 additions and 1 deletions

View File

@ -644,11 +644,12 @@ static int do_cmd_prog(char **arg, int prog_flags)
return -1;
in = fopen(path, "rb");
free(path);
if (!in) {
printc_err("prog: %s: %s\n", path, last_error());
free(path);
return -1;
}
free(path);
if (device_ctl(DEVICE_CTL_HALT) < 0) {
fclose(in);