Skip to content

Commit bf85cf7

Browse files
authored
Merge pull request #2690 from hjelmn/v2.x_cvar_fix
mca/base: account for NULL string_value in verbose set
2 parents a2e9935 + 35c79bb commit bf85cf7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

opal/mca/base/mca_base_var_enum.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ static int mca_base_var_enum_verbose_sfv (mca_base_var_enum_t *self, const int v
171171

172172
for (int i = 0 ; verbose_values[i].string ; ++i) {
173173
if (verbose_values[i].value == value) {
174-
*string_value = strdup (verbose_values[i].string);
174+
if (string_value) {
175+
*string_value = strdup (verbose_values[i].string);
176+
}
175177
return OPAL_SUCCESS;
176178
}
177179
}

0 commit comments

Comments
 (0)