1
1

Protect a potentially uninitialized variable (orte_sstore_base_global_snapshot_ref).

If orte_sstore_base_global_snapshot_ref is null, then it will default appropriately when it is used. When prelaunching we always specify this parameter, but if we are not prelaunching it is possible to allow this to be null and it will initialize when used. However we setup the prelaunching variable in both situtations and in the latter that would result in a NULL reference. This patch protects that code segment.

This commit was SVN r27289.
Этот коммит содержится в:
Josh Hursey 2012-09-11 15:14:28 +00:00
родитель ca40cb5f1c
Коммит 40132f1874

Просмотреть файл

@ -1,6 +1,8 @@
/*
* Copyright (c) 2010 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2012 The University of Wisconsin-La Crosse. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -160,11 +162,13 @@ int orte_sstore_base_open(void)
* Setup the prelaunch variable to point to the first possible snapshot
* location
*/
asprintf(&orte_sstore_base_prelaunch_location,
"%s/%s/%d",
orte_sstore_base_global_snapshot_dir,
orte_sstore_base_global_snapshot_ref,
0);
if( NULL != orte_sstore_base_global_snapshot_ref ) {
asprintf(&orte_sstore_base_prelaunch_location,
"%s/%s/%d",
orte_sstore_base_global_snapshot_dir,
orte_sstore_base_global_snapshot_ref,
0);
}
opal_output_verbose(10, orte_sstore_base_output,
"sstore:base: open()");
@ -176,7 +180,7 @@ int orte_sstore_base_open(void)
(NULL == orte_sstore_base_global_snapshot_ref ? "Default" : orte_sstore_base_global_snapshot_ref));
opal_output_verbose(10, orte_sstore_base_output,
"sstore:base: open: Prelaunch location = %s",
orte_sstore_base_prelaunch_location);
(NULL == orte_sstore_base_prelaunch_location ? "Undefined" : orte_sstore_base_prelaunch_location));
/*
* Which Sstore component to open