diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index ae25c8974c..9a3bcf8b61 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -865,8 +865,10 @@ virStorageBackendCreateQemuImgCmd(virConnectPtr conn, do_encryption, preallocate, vol->target.format, vol->target.compat, - vol->target.features) < 0) + vol->target.features) < 0) { + virCommandFree(cmd); return NULL; + } if (opts) virCommandAddArgList(cmd, "-o", opts, NULL); VIR_FREE(opts);