File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Windows/sgx/libsgx_tsgxssl Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ extern "C" {
7878 }
7979
8080 if (sgx_thread_mutex_init (mutex, NULL ) != 0 ) {
81+ delete mutex;
8182 errno = EINVAL;
8283 FEND;
8384 return 0 ;
@@ -88,10 +89,10 @@ extern "C" {
8889 }
8990 catch (std::bad_alloc e)
9091 {
91- sgx_spin_unlock (&mutex_map_lock);
9292 (void )e; // remove warning
9393 if (p_mutex_dat != NULL ) // second memory allocation failed
9494 delete p_mutex_dat;
95+ delete mutex;
9596 errno = ENOMEM;
9697 FEND;
9798 return 0 ;
@@ -200,10 +201,12 @@ extern "C" {
200201 }
201202
202203 // Free mutex and delete the mutex_it
204+ mutex_count * p_mutex_count = it->second ;
203205 sgx_thread_mutex_t * mutex_it = it->second ->mutex ;
204206
205207 sgx_thread_mutex_destroy (mutex_it);
206208 delete mutex_it;
209+ delete p_mutex_count;
207210
208211 // delete the mutex_info_map entry
209212 mutex_info_map.erase (it);
@@ -213,7 +216,4 @@ extern "C" {
213216 FEND;
214217 return ;
215218 }
216-
217-
218-
219219}
You can’t perform that action at this time.
0 commit comments