QPID-8425: Fix for channel leak on federation links
diff --git a/src/qpid/broker/Link.cpp b/src/qpid/broker/Link.cpp
index 14737e7..3dd8161 100644
--- a/src/qpid/broker/Link.cpp
+++ b/src/qpid/broker/Link.cpp
@@ -372,6 +372,10 @@
             setStateLH(STATE_WAITING);
             mgmtObject->set_lastError (text);
         }
+
+        if (failover && failoverChannel > 0) {
+            returnChannel(failoverChannel);
+        }
     }
     if (isClosing) destroy();
 }