Index: source/ariba/overlay/BaseOverlay.cpp
===================================================================
--- source/ariba/overlay/BaseOverlay.cpp	(revision 5687)
+++ source/ariba/overlay/BaseOverlay.cpp	(revision 5698)
@@ -944,4 +944,6 @@
 	logging_debug( "Handling message: " << message->toString());
 
+	bool ret = false;
+
 	// decapsulate overlay message
 	OverlayMsg* overlayMsg =
@@ -973,5 +975,6 @@
 					"Received join request for spovnet we don't handle " <<
 					joinReq->getSpoVNetID().toString() );
-				return false;
+				ret = false;
+				break;
 			}
 
@@ -994,5 +997,6 @@
 			retmsg.encapsulate(&replyMsg);
 			bc->sendMessage( bcLink, &retmsg );
-			return true;
+			ret = true;
+			break;
 		}
 
@@ -1011,5 +1015,7 @@
 						replyMsg->getSpoVNetID().toString() <<
 						" != " << spovnetId.toString() );
-				return false;
+				ret = false;
+				delete replyMsg;
+				break;
 			}
 
@@ -1033,5 +1039,7 @@
 					i->onJoinFailed( spovnetId );
 
-				return true;
+				ret = true;
+				delete replyMsg;
+				break;
 			}
 
@@ -1072,5 +1080,7 @@
 					i->onJoinFailed( spovnetId );
 
-					return true;
+					delete replyMsg;
+					ret = true;
+					break;
 				}
 
@@ -1088,4 +1098,6 @@
 					i->onJoinCompleted( spovnetId );
 
+				delete replyMsg;
+
 			} else {
 
@@ -1094,7 +1106,10 @@
 				overlayInterface->joinOverlay( replyMsg->getBootstrapEndpoint() );
 
+				delete replyMsg;
+
 			} // if( overlayInterface == NULL )
 
-			return true;
+			ret = true;
+			break;
 		}
 
@@ -1111,5 +1126,8 @@
 			CommunicationListener* listener =
 				communicationListeners.get( service );
-			if( listener == NULL ) return true;
+			if( listener == NULL ) {
+				ret = true;
+				break;
+			}
 
 			// delegate data message
@@ -1117,5 +1135,6 @@
 				overlayMsg->getSourceNode(), ld->overlayId );
 
-			return true;
+			ret = true;
+			break;
 		}
 
@@ -1134,5 +1153,6 @@
 				logging_warn( "received overlay update message for link " <<
 						ld->overlayId.toString() << " for which we have no mapping" );
-				return false;
+				ret = false;
+				break;
 			}
 
@@ -1154,5 +1174,6 @@
 			if( !communicationListeners.contains( service ) ) {
 				logging_warn( "Link up: event listener has not been registered" );
-				return false;
+				ret = false;
+				break;
 			}
 
@@ -1161,5 +1182,6 @@
 			if( listener == NULL || listener == &CommunicationListener::DEFAULT ) {
 				logging_warn("Link up: event listener is default or null!" );
-				return true;
+				ret = true;
+				break;
 			}
 
@@ -1180,5 +1202,6 @@
 				// drop the link
 				dropLink( ld->overlayId );
-				return true;
+				ret = true;
+				break;
 			}
 
@@ -1206,5 +1229,6 @@
 			sideport->onLinkUp( ld->overlayId, nodeId, sourcenode, this->spovnetId );
 
-			return true;
+			ret = true;
+			break;
 		}
 
@@ -1227,5 +1251,6 @@
 				if ( i == pendingLinks.end() ) {
 					logging_error( "Nonce not found in link request" );
-					return true;
+					ret = true;
+					break;
 				}
 
@@ -1241,5 +1266,9 @@
 				// get descriptor
 				LinkDescriptor* ldn = getDescriptor(i->second);
-				if (ldn==NULL) return true;
+				if (ldn==NULL) {
+					delete linkReq;
+					ret = true;
+					break;
+				}
 
 				// check if link request reply has a relay node ...
@@ -1330,5 +1359,6 @@
 			}
 			delete linkReq;
-			return true;
+			ret = true;
+			break;
 		}
 
@@ -1360,5 +1390,6 @@
 						logging_debug("Relay message reached destination. Handling the message.");
 						handleMessage( relayMsg, relayMsg->getDestLink(), LinkID::UNSPECIFIED, remoteNode );
-						return true;
+						ret = true;
+						break;
 					}
 
@@ -1377,5 +1408,6 @@
 						sendOverlay( &_overMsg, relayMsg->getRelayNode() );
 					}
-					return true;
+					ret = true;
+					break;
 				}
 
@@ -1394,5 +1426,6 @@
 						logging_debug("Relay message reached destination. Handling the message.");
 						handleMessage( relayMsg, relayMsg->getDestLink(), LinkID::UNSPECIFIED, remoteNode );
-						return true;
+						ret = true;
+						break;
 					}
 
@@ -1406,14 +1439,17 @@
 						/// this must be handled by using relay link!
 						sendOverlay(&_overMsg, relayMsg->getDestNode());
-						return true;
+						ret = true;
+						break;
 					}
 
 					// error: I'm not a relay or destination!
 					logging_error("This node is neither relay nor destination. Dropping Message!");
-					return true;
+					ret = true;
+					break;
 				}
 				default: {
 					logging_error("RelayMessage Unknown!");
-					return true;
+					ret = true;
+					break;
 				}
 			}
@@ -1476,9 +1512,11 @@
 					"what to do with this message of type " <<
 					overlayMsg->getType() );
-			return false;
+			ret = false;
+			break;
 		}
 	} /* switch */
 
-	return false;
+	delete overlayMsg;
+	return ret;
 }
 
