mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
libxlDomainMigrationDstPrepareDef: remove use of temporary variable
We can free 'def->name' directly. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com
This commit is contained in:
parent
63d08bec0b
commit
84a4208ed2
@ -449,7 +449,6 @@ libxlDomainMigrationDstPrepareDef(libxlDriverPrivatePtr driver,
|
||||
{
|
||||
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
|
||||
virDomainDefPtr def;
|
||||
char *name = NULL;
|
||||
|
||||
if (!dom_xml) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
@ -464,13 +463,12 @@ libxlDomainMigrationDstPrepareDef(libxlDriverPrivatePtr driver,
|
||||
goto cleanup;
|
||||
|
||||
if (dname) {
|
||||
name = def->name;
|
||||
VIR_FREE(def->name);
|
||||
def->name = g_strdup(dname);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
virObjectUnref(cfg);
|
||||
VIR_FREE(name);
|
||||
return def;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user