Skip to content

Commit 9bd4fc8

Browse files
committed
osc/sm: fix the osc_free callback
If component selection fails, then module->bases might be unallocated when ompi_osc_sm_free() in invoked, so test it before trying to free() module->bases[0]. Thanks Martin Binder for the report. Refs #4770 Signed-off-by: Gilles Gouaillardet <[email protected]> (cherry picked from commit 34b45cc)
1 parent eaf22c4 commit 9bd4fc8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* reserved.
66
* Copyright (c) 2014 Intel, Inc. All rights reserved.
77
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
8-
* Copyright (c) 2015-2017 Research Organization for Information Science
8+
* Copyright (c) 2015-2018 Research Organization for Information Science
99
* and Technology (RIST). All rights reserved.
1010
* Copyright (c) 2017 The University of Tennessee and The University
1111
* of Tennessee Research Foundation. All rights
@@ -485,7 +485,9 @@ ompi_osc_sm_free(struct ompi_win_t *win)
485485
} else {
486486
free(module->node_states);
487487
free(module->global_state);
488-
free(module->bases[0]);
488+
if (NULL != module->bases) {
489+
free(module->bases[0]);
490+
}
489491
}
490492
free(module->disp_units);
491493
free(module->outstanding_locks);

0 commit comments

Comments
 (0)