Skip to content

Commit a750a4d

Browse files
author
David Wootton
committed
Resolve Coverity problems reported in issue #9705
The Coverity CID numbers resolved by this pull request are CID 1494435 CID 1494436 Signed-off-by: David Wootton <dwootton@us.ibm.com> (cherry picked from commit 82a868e)
1 parent 41b8497 commit a750a4d

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)