Support initiation of childless IKEv1 ISAKMP SAs
authorMartin Willi <martin@revosec.ch>
Tue, 3 Jan 2012 10:58:40 +0000 (11:58 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:32 +0000 (17:31 +0100)
src/libcharon/sa/ike_sa.c

index c7a8a97..73b4ba2 100644 (file)
@@ -1066,7 +1066,7 @@ METHOD(ike_sa_t, initiate, status_t,
 #endif /* ME */
                        )
                {
-                       child_cfg->destroy(child_cfg);
+                       DESTROY_IF(child_cfg);
                        DBG1(DBG_IKE, "unable to initiate to %%any");
                        charon->bus->alert(charon->bus, ALERT_PEER_ADDR_FAILED);
                        return DESTROY_ME;
@@ -1090,6 +1090,7 @@ METHOD(ike_sa_t, initiate, status_t,
        }
        else
 #endif /* ME */
+       if (child_cfg)
        {
                /* normal IKE_SA with CHILD_SA */
                this->task_manager->queue_child(this->task_manager, child_cfg, reqid,