trap-manager: Also clean up remote address in error cases
authorTobias Brunner <tobias@strongswan.org>
Tue, 10 Nov 2015 13:00:11 +0000 (14:00 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 10 Nov 2015 13:00:11 +0000 (14:00 +0100)
Fixes #1201.

src/libcharon/sa/trap_manager.c

index 63505c9..90ad7e4 100644 (file)
@@ -211,6 +211,7 @@ METHOD(trap_manager_t, install, u_int32_t,
        if (this->installing == INSTALL_DISABLED)
        {       /* flush() has been called */
                this->lock->unlock(this->lock);
+               other->destroy(other);
                me->destroy(me);
                return 0;
        }
@@ -235,6 +236,7 @@ METHOD(trap_manager_t, install, u_int32_t,
                {
                        DBG1(DBG_CFG, "CHILD_SA '%s' is already being routed", found->name);
                        this->lock->unlock(this->lock);
+                       other->destroy(other);
                        me->destroy(me);
                        return 0;
                }