aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Egerer <thomas.egerer@secunet.com>2011-11-04 09:24:51 +0100
committerTobias Brunner <tobias@strongswan.org>2011-11-04 11:11:17 +0100
commitdbd2169569d195954e5854147e34bb60520cdffc (patch)
tree52c7a9caf5b247b40ae33f7bbaa9098452693cd8 /src
parentc230885a07fb87a5a5c34e01204ac25ae319a316 (diff)
downloadstrongswan-dbd2169569d195954e5854147e34bb60520cdffc.tar.bz2
strongswan-dbd2169569d195954e5854147e34bb60520cdffc.tar.xz
Change order of destroy/get_ref function calls
Since DESTROY_IF might destroy the peer_cfg, a get_ref on a freed object is subject to fail.
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/sa/ike_sa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c
index 6536acf07..75868ab2c 100644
--- a/src/libcharon/sa/ike_sa.c
+++ b/src/libcharon/sa/ike_sa.c
@@ -349,8 +349,8 @@ METHOD(ike_sa_t, get_peer_cfg, peer_cfg_t*,
METHOD(ike_sa_t, set_peer_cfg, void,
private_ike_sa_t *this, peer_cfg_t *peer_cfg)
{
- DESTROY_IF(this->peer_cfg);
peer_cfg->get_ref(peer_cfg);
+ DESTROY_IF(this->peer_cfg);
this->peer_cfg = peer_cfg;
if (this->ike_cfg == NULL)