mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 11:52:20 +00:00
storage: util: steal cmd in CreateQemuImgCmdFromVol
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
42823e67dc
commit
fd206c2867
@ -1116,7 +1116,7 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObj *pool,
|
|||||||
const char *inputSecretPath,
|
const char *inputSecretPath,
|
||||||
virStorageVolEncryptConvertStep convertStep)
|
virStorageVolEncryptConvertStep convertStep)
|
||||||
{
|
{
|
||||||
virCommand *cmd = NULL;
|
g_autoptr(virCommand) cmd = NULL;
|
||||||
struct _virStorageBackendQemuImgInfo info = {
|
struct _virStorageBackendQemuImgInfo info = {
|
||||||
.format = vol->target.format,
|
.format = vol->target.format,
|
||||||
.type = NULL,
|
.type = NULL,
|
||||||
@ -1246,11 +1246,10 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObj *pool,
|
|||||||
}
|
}
|
||||||
VIR_FREE(info.secretAlias);
|
VIR_FREE(info.secretAlias);
|
||||||
|
|
||||||
return cmd;
|
return g_steal_pointer(&cmd);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(info.secretAlias);
|
VIR_FREE(info.secretAlias);
|
||||||
virCommandFree(cmd);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user