From: Ján Tomko Date: Fri, 10 Dec 2021 16:19:18 +0000 (+0100) Subject: storage: util: steal cmd in CreateQemuImgCmdFromVol X-Git-Tag: v8.0.0-rc1~231 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd206c2867c057731980afd2481929415cf94fbb;p=thirdparty%2Flibvirt.git storage: util: steal cmd in CreateQemuImgCmdFromVol Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- 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; }