Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx> --- 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; } -- 2.31.1