@@ -673,7 +673,7 @@ static char **split_and_resolve(char **orig_str, char *name, bool reqd)
673673 opal_output_verbose (20 ,
674674 opal_btl_base_framework .framework_output ,
675675 "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 ]);
677677 }
678678 continue ;
679679 }
@@ -735,7 +735,7 @@ static char **split_and_resolve(char **orig_str, char *name, bool reqd)
735735 "btl: tcp: Found match: %s (%s)" ,
736736 opal_net_get_hostname ((struct sockaddr * ) & if_inaddr ),
737737 if_name );
738- opal_argv_append (& interface_count , & interfaces , strdup ( if_name ) );
738+ opal_argv_append (& interface_count , & interfaces , if_name );
739739 }
740740 }
741741 }
@@ -755,7 +755,9 @@ static char **split_and_resolve(char **orig_str, char *name, bool reqd)
755755 }
756756
757757 /* 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+ }
759761 free (argv );
760762 free (* orig_str );
761763 * orig_str = opal_argv_join (interfaces , ',' );
0 commit comments