@@ -278,8 +278,8 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
278
278
total += rbuf [i ];
279
279
}
280
280
281
- /* user opal/shmem directly to create a shared memory segment */
282
- state_size = sizeof (ompi_osc_sm_global_state_t ) + sizeof (ompi_osc_sm_node_state_t ) * comm_size ;
281
+ /* user opal/shmem directly to create a shared memory segment */
282
+ state_size = sizeof (ompi_osc_sm_global_state_t ) + sizeof (ompi_osc_sm_node_state_t ) * comm_size ;
283
283
state_size += OPAL_ALIGN_PAD_AMOUNT (state_size , 64 );
284
284
posts_size = comm_size * post_size * sizeof (module -> posts [0 ][0 ]);
285
285
posts_size += OPAL_ALIGN_PAD_AMOUNT (posts_size , 64 );
@@ -289,34 +289,39 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
289
289
mca_osc_sm_component .backing_directory , ompi_process_info .nodename ,
290
290
OMPI_PROC_MY_NAME -> jobid , (int ) OMPI_PROC_MY_NAME -> vpid , ompi_comm_get_cid (module -> comm ));
291
291
if (ret < 0 ) {
292
+ free (rbuf );
292
293
return OMPI_ERR_OUT_OF_RESOURCE ;
293
294
}
294
295
295
296
ret = opal_shmem_segment_create (& module -> seg_ds , data_file , total + pagesize + state_size + posts_size );
296
297
free (data_file );
297
298
if (OPAL_SUCCESS != ret ) {
299
+ free (rbuf );
298
300
goto error ;
299
301
}
300
302
301
303
unlink_needed = true;
302
304
}
303
305
304
- ret = module -> comm -> c_coll -> coll_bcast (& module -> seg_ds , sizeof (module -> seg_ds ), MPI_BYTE , 0 ,
305
- module -> comm , module -> comm -> c_coll -> coll_bcast_module );
306
- if (OMPI_SUCCESS != ret ) {
307
- goto error ;
308
- }
306
+ ret = module -> comm -> c_coll -> coll_bcast (& module -> seg_ds , sizeof (module -> seg_ds ), MPI_BYTE , 0 ,
307
+ module -> comm , module -> comm -> c_coll -> coll_bcast_module );
308
+ if (OMPI_SUCCESS != ret ) {
309
+ free (rbuf );
310
+ goto error ;
311
+ }
309
312
310
- module -> segment_base = opal_shmem_segment_attach (& module -> seg_ds );
311
- if (NULL == module -> segment_base ) {
312
- goto error ;
313
- }
313
+ module -> segment_base = opal_shmem_segment_attach (& module -> seg_ds );
314
+ if (NULL == module -> segment_base ) {
315
+ free (rbuf );
316
+ goto error ;
317
+ }
314
318
315
319
/* wait for all processes to attach */
316
- ret = module -> comm -> c_coll -> coll_barrier (module -> comm , module -> comm -> c_coll -> coll_barrier_module );
317
- if (OMPI_SUCCESS != ret ) {
318
- goto error ;
319
- }
320
+ ret = module -> comm -> c_coll -> coll_barrier (module -> comm , module -> comm -> c_coll -> coll_barrier_module );
321
+ if (OMPI_SUCCESS != ret ) {
322
+ free (rbuf );
323
+ goto error ;
324
+ }
320
325
321
326
if (0 == ompi_comm_rank (module -> comm )) {
322
327
opal_shmem_unlink (& module -> seg_ds );
0 commit comments