diff --git a/src/rm/RequestManagerDelete.cc b/src/rm/RequestManagerDelete.cc index 52c757adda..b29f5d7ee9 100644 --- a/src/rm/RequestManagerDelete.cc +++ b/src/rm/RequestManagerDelete.cc @@ -157,6 +157,9 @@ int HostDelete::drop(int oid, PoolObjectSQL * object, string& error_msg) if ( host->get_share_running_vms() > 0 ) { error_msg = "Can not remove a host with running VMs"; + + host->unlock(); + return -1; }