1*1a4b7ee2SBrad BishopFrom b8bc6bfdb5e7fb5b46d3a830e04632939bee6b98 Mon Sep 17 00:00:00 2001 2*1a4b7ee2SBrad BishopFrom: Catalin Enache <catalin.enache@windriver.com> 3*1a4b7ee2SBrad BishopDate: Fri, 9 Feb 2018 16:35:11 +0200 4*1a4b7ee2SBrad BishopSubject: [PATCH] saHpiSessionClose: close socket 5*1a4b7ee2SBrad Bishop 6*1a4b7ee2SBrad BishopsaHpiSessionClose leaks file descriptors 7*1a4b7ee2SBrad Bishop 8*1a4b7ee2SBrad BishopUpstream issue: https://github.com/open-hpi/openhpi/issues/1918 9*1a4b7ee2SBrad Bishop 10*1a4b7ee2SBrad BishopUpstream-Status: Pending 11*1a4b7ee2SBrad Bishop 12*1a4b7ee2SBrad BishopSigned-off-by: Catalin Enache <catalin.enache@windriver.com> 13*1a4b7ee2SBrad BishopSigned-off-by: Yi Zhao <yi.zhao@windriver.com> 14*1a4b7ee2SBrad Bishop--- 15*1a4b7ee2SBrad Bishop baselib/session.cpp | 6 ++++++ 16*1a4b7ee2SBrad Bishop 1 file changed, 6 insertions(+) 17*1a4b7ee2SBrad Bishop 18*1a4b7ee2SBrad Bishopdiff --git a/baselib/session.cpp b/baselib/session.cpp 19*1a4b7ee2SBrad Bishopindex c5edfc8..4ece1b7 100644 20*1a4b7ee2SBrad Bishop--- a/baselib/session.cpp 21*1a4b7ee2SBrad Bishop+++ b/baselib/session.cpp 22*1a4b7ee2SBrad Bishop@@ -126,6 +126,12 @@ cSession::cSession() 23*1a4b7ee2SBrad Bishop 24*1a4b7ee2SBrad Bishop cSession::~cSession() 25*1a4b7ee2SBrad Bishop { 26*1a4b7ee2SBrad Bishop+ cClientStreamSock * sock; 27*1a4b7ee2SBrad Bishop+ gpointer ptr = wrap_g_static_private_get( &m_sockets ); 28*1a4b7ee2SBrad Bishop+ if ( ptr ) { 29*1a4b7ee2SBrad Bishop+ sock = reinterpret_cast<cClientStreamSock *>(ptr); 30*1a4b7ee2SBrad Bishop+ sock->Close(); 31*1a4b7ee2SBrad Bishop+ } 32*1a4b7ee2SBrad Bishop wrap_g_static_private_free( &m_sockets ); 33*1a4b7ee2SBrad Bishop } 34*1a4b7ee2SBrad Bishop 35*1a4b7ee2SBrad Bishop-- 36*1a4b7ee2SBrad Bishop2.10.2 37*1a4b7ee2SBrad Bishop 38