The 'output' is allocated in get_options(), don't forget to free it
in error paths, move 'output' freeing out of close_target(), which
simplifies the logic of close_target().
Fixes: 36ec51948e0ec ("Add mkfs.ubifs")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
if (close(out_fd) == -1)
return sys_err_msg("cannot close the target '%s'", output);
}
- if (output)
- free(output);
return 0;
}
printf("Success!\n");
out:
+ free(output);
close_ubi();
crypto_cleanup();
return err;