@@ -706,10 +706,8 @@ int orte_submit_job(char *argv[], int *index,
706
706
707
707
/* reset the globals every time thru as the argv
708
708
* will modify them */
709
- if (NULL != orte_cmd_options .prefix ) {
710
- free (orte_cmd_options .prefix );
711
- }
712
- memset (& orte_cmd_options , 0 , sizeof (orte_cmd_options ));
709
+ init_globals ();
710
+
713
711
argc = opal_argv_count (argv );
714
712
715
713
/* parse the cmd line - do this every time thru so we can
@@ -1099,20 +1097,60 @@ static int init_globals(void)
1099
1097
orte_cmd_options .num_procs = 0 ;
1100
1098
if (NULL != orte_cmd_options .appfile ) {
1101
1099
free (orte_cmd_options .appfile );
1100
+ orte_cmd_options .appfile = NULL ;
1102
1101
}
1103
- orte_cmd_options .appfile = NULL ;
1104
1102
if (NULL != orte_cmd_options .wdir ) {
1105
1103
free (orte_cmd_options .wdir );
1104
+ orte_cmd_options .wdir = NULL ;
1106
1105
}
1107
1106
orte_cmd_options .set_cwd_to_session_dir = false;
1108
- orte_cmd_options .wdir = NULL ;
1109
1107
if (NULL != orte_cmd_options .path ) {
1110
1108
free (orte_cmd_options .path );
1109
+ orte_cmd_options .path = NULL ;
1110
+ }
1111
+ if (NULL != orte_cmd_options .hnp ) {
1112
+ free (orte_cmd_options .hnp );
1113
+ orte_cmd_options .hnp = NULL ;
1114
+ }
1115
+ if (NULL != orte_cmd_options .stdin_target ) {
1116
+ free (orte_cmd_options .stdin_target );
1117
+ orte_cmd_options .stdin_target = NULL ;
1118
+ }
1119
+ if (NULL != orte_cmd_options .output_filename ) {
1120
+ free (orte_cmd_options .output_filename );
1121
+ orte_cmd_options .output_filename = NULL ;
1122
+ }
1123
+ if (NULL != orte_cmd_options .binding_policy ) {
1124
+ free (orte_cmd_options .binding_policy );
1125
+ orte_cmd_options .binding_policy = NULL ;
1126
+ }
1127
+ if (NULL != orte_cmd_options .mapping_policy ) {
1128
+ free (orte_cmd_options .mapping_policy );
1129
+ orte_cmd_options .mapping_policy = NULL ;
1130
+ }
1131
+ if (NULL != orte_cmd_options .ranking_policy ) {
1132
+ free (orte_cmd_options .ranking_policy );
1133
+ orte_cmd_options .ranking_policy = NULL ;
1111
1134
}
1112
- orte_cmd_options .path = NULL ;
1113
1135
1136
+ if (NULL != orte_cmd_options .report_pid ) {
1137
+ free (orte_cmd_options .report_pid );
1138
+ orte_cmd_options .report_pid = NULL ;
1139
+ }
1140
+ if (NULL != orte_cmd_options .report_uri ) {
1141
+ free (orte_cmd_options .report_uri );
1142
+ orte_cmd_options .report_uri = NULL ;
1143
+ }
1144
+ if (NULL != orte_cmd_options .slot_list ) {
1145
+ free (orte_cmd_options .slot_list );
1146
+ orte_cmd_options .slot_list = NULL ;
1147
+ }
1114
1148
orte_cmd_options .preload_binaries = false;
1115
- orte_cmd_options .preload_files = NULL ;
1149
+ if (NULL != orte_cmd_options .preload_files ) {
1150
+ free (orte_cmd_options .preload_files );
1151
+ orte_cmd_options .preload_files = NULL ;
1152
+ }
1153
+
1116
1154
1117
1155
/* All done */
1118
1156
return ORTE_SUCCESS ;
0 commit comments