From a4082247a4934a7396265e9e4f845e65501bc6d7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 29 Mar 2013 11:23:30 +0000 Subject: crash fix git-svn-id: http://svn.miranda-ng.org/main/trunk@4231 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CryptoPP/src/cpp_rsam.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/CryptoPP/src/cpp_rsam.cpp b/plugins/CryptoPP/src/cpp_rsam.cpp index a45cf4d9da..36dacf7e0b 100644 --- a/plugins/CryptoPP/src/cpp_rsam.cpp +++ b/plugins/CryptoPP/src/cpp_rsam.cpp @@ -863,18 +863,19 @@ void rsa_alloc( pCNTX ptr ) { void rsa_free( pCNTX ptr ) { pRSADATA p = (pRSADATA) ptr->pdata; - if (p && p->event) { + if (p == NULL) + return; + + if (p->event) { p->thread_exit = 2; // отпускаем поток в свободное плавание SetEvent( p->event ); } - else { - delete p->queue; - delete p; - ptr->pdata = NULL; - } + + delete p->queue; + delete p; + ptr->pdata = NULL; } - void rsa_free_thread( pRSADATA p ) { if ( p->event ) { p->thread_exit = 1; -- cgit v1.2.3