diff options
author | Martin Willi <martin@revosec.ch> | 2013-07-08 10:40:25 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-07-18 16:00:30 +0200 |
commit | d3278c1f7393ce8d60b8069f08cafd03efd93b21 (patch) | |
tree | fef7cc2e9c8f196c6df40ac7e165bb81c4313917 /src | |
parent | cfdb5f48554018a81b5ebcb77cf5c1b463dedd99 (diff) | |
download | strongswan-d3278c1f7393ce8d60b8069f08cafd03efd93b21.tar.bz2 strongswan-d3278c1f7393ce8d60b8069f08cafd03efd93b21.tar.xz |
lookip: fix error handling when creating the socket fails
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/plugins/lookip/lookip_plugin.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libcharon/plugins/lookip/lookip_plugin.c b/src/libcharon/plugins/lookip/lookip_plugin.c index 4466ad99f..63b138162 100644 --- a/src/libcharon/plugins/lookip/lookip_plugin.c +++ b/src/libcharon/plugins/lookip/lookip_plugin.c @@ -80,7 +80,7 @@ METHOD(plugin_t, get_features, int, METHOD(plugin_t, destroy, void, private_lookip_plugin_t *this) { - this->socket->destroy(this->socket); + DESTROY_IF(this->socket); this->listener->destroy(this->listener); free(this); } @@ -108,7 +108,13 @@ plugin_t *lookip_plugin_create() }, .listener = lookip_listener_create(), ); + this->socket = lookip_socket_create(this->listener); + if (!this->socket) + { + destroy(this); + return NULL; + } return &this->public.plugin; } |