@@ -288,9 +288,9 @@ TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate
288
288
tsrm_resource_type * _tmp ;
289
289
_tmp = (tsrm_resource_type * ) realloc (resource_types_table , sizeof (tsrm_resource_type )* id_count );
290
290
if (!_tmp ) {
291
- tsrm_mutex_unlock (tsmm_mutex );
292
291
TSRM_ERROR ((TSRM_ERROR_LEVEL_ERROR , "Unable to allocate storage for resource" ));
293
292
* rsrc_id = 0 ;
293
+ tsrm_mutex_unlock (tsmm_mutex );
294
294
return 0 ;
295
295
}
296
296
resource_types_table = _tmp ;
@@ -331,10 +331,10 @@ TSRM_API ts_rsrc_id ts_allocate_fast_id(ts_rsrc_id *rsrc_id, size_t *offset, siz
331
331
332
332
size = TSRM_ALIGNED_SIZE (size );
333
333
if (tsrm_reserved_size - tsrm_reserved_pos < size ) {
334
- tsrm_mutex_unlock (tsmm_mutex );
335
334
TSRM_ERROR ((TSRM_ERROR_LEVEL_ERROR , "Unable to allocate space for fast resource" ));
336
335
* rsrc_id = 0 ;
337
336
* offset = 0 ;
337
+ tsrm_mutex_unlock (tsmm_mutex );
338
338
return 0 ;
339
339
}
340
340
@@ -346,9 +346,9 @@ TSRM_API ts_rsrc_id ts_allocate_fast_id(ts_rsrc_id *rsrc_id, size_t *offset, siz
346
346
tsrm_resource_type * _tmp ;
347
347
_tmp = (tsrm_resource_type * ) realloc (resource_types_table , sizeof (tsrm_resource_type )* id_count );
348
348
if (!_tmp ) {
349
- tsrm_mutex_unlock (tsmm_mutex );
350
349
TSRM_ERROR ((TSRM_ERROR_LEVEL_ERROR , "Unable to allocate storage for resource" ));
351
350
* rsrc_id = 0 ;
351
+ tsrm_mutex_unlock (tsmm_mutex );
352
352
return 0 ;
353
353
}
354
354
resource_types_table = _tmp ;
0 commit comments