@@ -673,7 +673,7 @@ static char **split_and_resolve(char **orig_str, char *name, bool reqd)
673
673
opal_output_verbose (20 ,
674
674
opal_btl_base_framework .framework_output ,
675
675
"btl: tcp: Using interface: %s " , argv [i ]);
676
- opal_argv_append (& interface_count , & interfaces , strdup ( argv [i ]) );
676
+ opal_argv_append (& interface_count , & interfaces , argv [i ]);
677
677
}
678
678
continue ;
679
679
}
@@ -735,7 +735,7 @@ static char **split_and_resolve(char **orig_str, char *name, bool reqd)
735
735
"btl: tcp: Found match: %s (%s)" ,
736
736
opal_net_get_hostname ((struct sockaddr * ) & if_inaddr ),
737
737
if_name );
738
- opal_argv_append (& interface_count , & interfaces , strdup ( if_name ) );
738
+ opal_argv_append (& interface_count , & interfaces , if_name );
739
739
}
740
740
}
741
741
}
@@ -755,7 +755,9 @@ static char **split_and_resolve(char **orig_str, char *name, bool reqd)
755
755
}
756
756
757
757
/* Mark the end of the interface name array with NULL */
758
- interfaces [interface_count ] = NULL ;
758
+ if (NULL != interfaces ) {
759
+ interfaces [interface_count ] = NULL ;
760
+ }
759
761
free (argv );
760
762
free (* orig_str );
761
763
* orig_str = opal_argv_join (interfaces , ',' );
0 commit comments