Skip to content

Commit f33221f

Browse files
authored
Merge pull request #9710 from drwootton/fix_btl_coverity
Resolve Coverity problems reported in issue #9705
2 parents bc7bb12 + 82a868e commit f33221f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

opal/mca/btl/tcp/btl_tcp_component.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)