mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
vsh-table: Refactor cleanup in 'vshTableRowNew'
The 'error' label is not needed, we can directly return failure from the only error. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
1 parent
e5b4d2d734
commit
2c8fe80dac
1 file changed
+1
-5
+1
-5
@@ -92,7 +92,7 @@ vshTableRowNew(const char *arg, va_list ap)
|
||||
if (!arg) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Table row cannot be empty"));
|
||||
goto error;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
row = g_new0(vshTableRow, 1);
|
||||
@@ -108,10 +108,6 @@ vshTableRowNew(const char *arg, va_list ap)
|
||||
}
|
||||
|
||||
return row;
|
||||
|
||||
error:
|
||||
vshTableRowFree(row);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user