mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
util: Use virStorageSourceNew in virStorageFileMetadataNew
Commit dcda2bf4c110 forgot to fix this one instance. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
44601a0e96
commit
1e5634ec79
@ -1119,22 +1119,20 @@ static virStorageSourcePtr
|
|||||||
virStorageFileMetadataNew(const char *path,
|
virStorageFileMetadataNew(const char *path,
|
||||||
int format)
|
int format)
|
||||||
{
|
{
|
||||||
virStorageSourcePtr def = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) def = NULL;
|
||||||
|
virStorageSourcePtr ret = NULL;
|
||||||
|
|
||||||
if (VIR_ALLOC(def) < 0)
|
if (!(def = virStorageSourceNew()))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
def->format = format;
|
def->format = format;
|
||||||
def->type = VIR_STORAGE_TYPE_FILE;
|
def->type = VIR_STORAGE_TYPE_FILE;
|
||||||
|
|
||||||
if (VIR_STRDUP(def->path, path) < 0)
|
if (VIR_STRDUP(def->path, path) < 0)
|
||||||
goto error;
|
|
||||||
|
|
||||||
return def;
|
|
||||||
|
|
||||||
error:
|
|
||||||
virObjectUnref(def);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
VIR_STEAL_PTR(ret, def);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user