aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/smp/smp.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-04-26 08:50:39 +0200
committerTobias Brunner <tobias@strongswan.org>2012-04-26 08:54:04 +0200
commit23cb8ba72bf402594e99a9fb807061a914071036 (patch)
treea88af9864cd2f439c1fe8cbc00588b43a2407be0 /src/libcharon/plugins/smp/smp.c
parentd2976167af9e9e1df91e84d9353fe291c0fe5f50 (diff)
downloadstrongswan-23cb8ba72bf402594e99a9fb807061a914071036.tar.bz2
strongswan-23cb8ba72bf402594e99a9fb807061a914071036.tar.xz
Fixed null-pointer dereference in smp plugin.
Diffstat (limited to 'src/libcharon/plugins/smp/smp.c')
-rw-r--r--src/libcharon/plugins/smp/smp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libcharon/plugins/smp/smp.c b/src/libcharon/plugins/smp/smp.c
index 1873d9621..2b830012d 100644
--- a/src/libcharon/plugins/smp/smp.c
+++ b/src/libcharon/plugins/smp/smp.c
@@ -461,17 +461,21 @@ static void request_control_initiate(xmlTextReaderPtr reader,
/* <log> */
xmlTextWriterStartElement(writer, "log");
- peer = charon->backends->get_peer_cfg_by_name(charon->backends, (char*)str);
+ peer = charon->backends->get_peer_cfg_by_name(charon->backends,
+ (char*)str);
if (peer)
{
enumerator = peer->create_child_cfg_enumerator(peer);
if (ike)
{
- if (!enumerator->enumerate(enumerator, &child))
+ if (enumerator->enumerate(enumerator, &child))
+ {
+ child->get_ref(child);
+ }
+ else
{
child = NULL;
}
- child->get_ref(child);
}
else
{