Fix leaks in identifier generation
[shibboleth/cpp-sp.git] / shibsp / ServiceProvider.cpp
index 97d5a5e..4fbf074 100644 (file)
@@ -339,7 +339,12 @@ pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handl
                     throw ConfigurationException("No default session initiator found, check configuration.");
             }
 
-            return initiator->run(request, false);
+            // Dispatch to SessionInitiator. This MUST handle the request, or we want to fail here.
+            // Used to fall through into doExport, but this is a cleaner exit path.
+            pair<bool,long> ret = initiator->run(request, false);
+            if (ret.first)
+                return ret;
+            throw ConfigurationException("Session initiator did not handle request for a new session, check configuration.");
         }
 
         request.setAuthType(authType.second);