From 3e04ca51817674e3f39678c3fed670b059ddb199 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 29 Jan 2020 10:20:24 +0100 Subject: [PATCH] EapHost: Fix EapHostPeerGetSendPacket() call The packet buffer returned by EapHostPeerGetSendPacket() shall not be freed. Signed-off-by: Simon Rozman --- lib/EapHost/src/Method.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/EapHost/src/Method.cpp b/lib/EapHost/src/Method.cpp index 8bd4bb2..82fe102 100644 --- a/lib/EapHost/src/Method.cpp +++ b/lib/EapHost/src/Method.cpp @@ -120,17 +120,16 @@ void eap::method_eaphost::get_response_packet( _In_opt_ DWORD size_max) { // Let EapHost peer prepare response packet. - eap_blob_runtime _packet; + LPBYTE _packet; eap_error_runtime error; DWORD dwResult = EapHostPeerGetSendPacket( m_session_id, &size_max, - get_ptr(_packet), + &_packet, get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // Packet successfuly prepared. - LPCBYTE __packet = _packet.get(); - packet.assign(__packet, __packet + size_max); + packet.assign(_packet, _packet + size_max); } else if (error) throw eap_runtime_error(*error , __FUNCTION__ " EapHostPeerGetSendPacket failed."); else