aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_tnc.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-01-13 21:25:54 (GMT)
committerJouni Malinen <j@w1.fi>2016-01-13 21:30:25 (GMT)
commit49a26bb3e37ef7d3c9b8b55a5a331ae64a1cd0f3 (patch)
tree478920060b841fa12a0872e694e3a6a3eb869a48 /src/eap_peer/eap_tnc.c
parent7ce56032516896498bfd3d6a2891e53cf7cd31fd (diff)
downloadhostap-49a26bb3e37ef7d3c9b8b55a5a331ae64a1cd0f3.zip
hostap-49a26bb3e37ef7d3c9b8b55a5a331ae64a1cd0f3.tar.gz
hostap-49a26bb3e37ef7d3c9b8b55a5a331ae64a1cd0f3.tar.bz2
EAP peer: Simplify EAP method registration call
Free the allocated structure in error cases to remove need for each EAP method to handle the error cases separately. Each registration function can simply do "return eap_peer_method_register(eap);" in the end of the function. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/eap_peer/eap_tnc.c')
-rw-r--r--src/eap_peer/eap_tnc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/eap_peer/eap_tnc.c b/src/eap_peer/eap_tnc.c
index e4294bb..726221e 100644
--- a/src/eap_peer/eap_tnc.c
+++ b/src/eap_peer/eap_tnc.c
@@ -410,7 +410,6 @@ fail:
int eap_peer_tnc_register(void)
{
struct eap_method *eap;
- int ret;
eap = eap_peer_method_alloc(EAP_PEER_METHOD_INTERFACE_VERSION,
EAP_VENDOR_IETF, EAP_TYPE_TNC, "TNC");
@@ -421,8 +420,5 @@ int eap_peer_tnc_register(void)
eap->deinit = eap_tnc_deinit;
eap->process = eap_tnc_process;
- ret = eap_peer_method_register(eap);
- if (ret)
- eap_peer_method_free(eap);
- return ret;
+ return eap_peer_method_register(eap);
}