Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/bhyve/bhyve_process.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
index ead6b0e522..ee692d2ba3 100644
--- a/src/bhyve/bhyve_process.c
+++ b/src/bhyve/bhyve_process.c
@@ -285,7 +285,7 @@ virBhyveProcessStop(struct _bhyveConn *driver,
virDomainShutoffReason reason)
{
int ret = -1;
- virCommand *cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
bhyveDomainObjPrivate *priv = vm->privateData;
if (!virDomainObjIsActive(vm)) {
@@ -335,8 +335,6 @@ virBhyveProcessStop(struct _bhyveConn *driver,
bhyveProcessStopHook(vm, VIR_HOOK_BHYVE_OP_RELEASE);
cleanup:
- virCommandFree(cmd);
-
virPidFileDelete(BHYVE_STATE_DIR, vm->def->name);
virDomainDeleteConfig(BHYVE_STATE_DIR, NULL, vm);
--
2.31.1