manager can query and list IKE_SA status (no layout yet)
[strongswan.git] / src / manager / manager.c
index dc27f86..b09d8d3 100644 (file)
@@ -123,9 +123,12 @@ static bool login(private_manager_t *this, char *username, char *password)
  */
 static void logout(private_manager_t *this)
 {
+       if (this->gateway)
+       {
+               this->gateway->destroy(this->gateway);
+               this->gateway = NULL;
+       }
        this->user = 0;
-       this->gateway->destroy(this->gateway);
-       this->gateway = NULL;
 }
 
 /**