Fixed reference counting bugs in main mode
authorMartin Willi <martin@revosec.ch>
Mon, 21 Nov 2011 10:42:53 +0000 (11:42 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:30:44 +0000 (17:30 +0100)
src/libcharon/sa/tasks/main_mode.c

index 2de9c0e..4d0c570 100644 (file)
@@ -111,6 +111,7 @@ static auth_cfg_t *get_auth_cfg(private_main_mode_t *this, bool local)
        enumerator = this->peer_cfg->create_auth_cfg_enumerator(this->peer_cfg,
                                                                                                                        local);
        enumerator->enumerate(enumerator, &cfg);
+       enumerator->destroy(enumerator);
        return cfg;
 }
 
@@ -404,7 +405,7 @@ METHOD(task_t, build_r, status_t,
                                return FAILED;
                        }
 
-                       this->ike_sa->set_my_id(this->ike_sa, id);
+                       this->ike_sa->set_my_id(this->ike_sa, id->clone(id));
 
                        id_payload = id_payload_create_from_identification(ID_V1, id);
                        message->add_payload(message, &id_payload->payload_interface);