diff options
author | Tobias Brunner <tobias@strongswan.org> | 2015-03-25 13:23:14 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2015-03-25 13:23:14 +0100 |
commit | 97c7dc6d149454d728f4ae887d35dc00159e5fdc (patch) | |
tree | e0ade7ae5e560dd9c82e1699407f766d84850534 | |
parent | f4c37166f924d33b0ec4add6ddc2e63f16c5b433 (diff) | |
download | strongswan-97c7dc6d149454d728f4ae887d35dc00159e5fdc.tar.bz2 strongswan-97c7dc6d149454d728f4ae887d35dc00159e5fdc.tar.xz |
tnccs-20: Fix error handling in build()
-rw-r--r-- | src/libtnccs/plugins/tnccs_20/tnccs_20.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/libtnccs/plugins/tnccs_20/tnccs_20.c b/src/libtnccs/plugins/tnccs_20/tnccs_20.c index 3d8615ce0..d8daf9a9e 100644 --- a/src/libtnccs/plugins/tnccs_20/tnccs_20.c +++ b/src/libtnccs/plugins/tnccs_20/tnccs_20.c @@ -274,8 +274,6 @@ METHOD(tls_t, process, status_t, METHOD(tls_t, build, status_t, private_tnccs_20_t *this, void *buf, size_t *buflen, size_t *msglen) { - status_t status; - if (this->to_server) { DBG2(DBG_TNC, "TNC client is handling outbound connection"); @@ -292,11 +290,11 @@ METHOD(tls_t, build, status_t, this->max_msg_len); if (!this->tnc_client) { - status = FAILED; + return FAILED; } this->tnccs_handler = this->tnc_client; this->tnccs_handler->begin_handshake(this->tnccs_handler, - this->mutual); + this->mutual); } } else @@ -315,16 +313,14 @@ METHOD(tls_t, build, status_t, this->eap_transport); if (!this->tnc_server) { - status = FAILED; + return FAILED; } this->tnccs_handler = this->tnc_server; this->tnccs_handler->begin_handshake(this->tnccs_handler, - this->mutual); + this->mutual); } } - status = this->tnccs_handler->build(this->tnccs_handler, buf, buflen, msglen); - - return status; + return this->tnccs_handler->build(this->tnccs_handler, buf, buflen, msglen); } METHOD(tls_t, is_server, bool, |