Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
cmdCd(vshControl *ctl, const vshCmd *cmd)
{
const char *dir = NULL;
- char *dir_malloced = NULL;
- bool ret = true;
+ g_autofree char *dir_malloced = NULL;
char ebuf[1024];
if (!ctl->imode) {
if (chdir(dir) == -1) {
vshError(ctl, _("cd: %s: %s"),
virStrerror(errno, ebuf, sizeof(ebuf)), dir);
- ret = false;
+ return false;
}
- VIR_FREE(dir_malloced);
- return ret;
+ return true;
}
const vshCmdOptDef opts_echo[] = {