From 17f36a76cbf15e088d2973ed5608f93e09827f8a Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 13 Mar 2008 11:04:33 +0000 Subject: bugfix: imgssapi segfaulted under some conditions; this fix is actually not just a fix but a change in the object model. Thanks to varmojfekoj for providing the bug report, an initial fix and lots of good discussion that lead to where we finally ended up. --- tcps_sess.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tcps_sess.c') diff --git a/tcps_sess.c b/tcps_sess.c index 74de3c28..c8ac3a37 100644 --- a/tcps_sess.c +++ b/tcps_sess.c @@ -57,6 +57,10 @@ DEFobjStaticHelpers DEFobjCurrIf(errmsg) +/* forward definitions */ +static rsRetVal Close(tcps_sess_t *pThis); + + /* Standard-Constructor */ BEGINobjConstruct(tcps_sess) /* be sure to specify the object type also in END macro! */ @@ -86,6 +90,9 @@ finalize_it: /* destructor for the tcps_sess object */ BEGINobjDestruct(tcps_sess) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(tcps_sess) + if(pThis->sock != -1) + Close(pThis); + if(pThis->pSrv->pOnSessDestruct != NULL) { pThis->pSrv->pOnSessDestruct(&pThis->pUsr); } @@ -211,8 +218,8 @@ finalize_it: } -/* Closes a TCP session and marks its slot in the session - * table as unused. No attention is paid to the return code +/* Closes a TCP session + * No attention is paid to the return code * of close, so potential-double closes are not detected. */ static rsRetVal -- cgit