From fd206c2867c057731980afd2481929415cf94fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Fri, 10 Dec 2021 17:19:18 +0100 Subject: [PATCH] storage: util: steal cmd in CreateQemuImgCmdFromVol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- src/storage/storage_util.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index ce61f37172..bfc3edb1fd 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -1116,7 +1116,7 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObj *pool, const char *inputSecretPath, virStorageVolEncryptConvertStep convertStep) { - virCommand *cmd = NULL; + g_autoptr(virCommand) cmd = NULL; struct _virStorageBackendQemuImgInfo info = { .format = vol->target.format, .type = NULL, @@ -1246,11 +1246,10 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObj *pool, } VIR_FREE(info.secretAlias); - return cmd; + return g_steal_pointer(&cmd); error: VIR_FREE(info.secretAlias); - virCommandFree(cmd); return NULL; }