fix coverity issues

3388.	[bug]		Fixed several Coverity warnings. [RT #30996]
This commit is contained in:
Evan Hunt
2012-10-02 23:46:15 -07:00
parent a5a7e9785a
commit 8c18302d8b
26 changed files with 119 additions and 86 deletions

View File

@@ -950,7 +950,8 @@ copyandmerge(struct hostent *he1, struct hostent *he2, int af, int *error_num)
* Copy aliases.
*/
npp = he->h_aliases;
cpp = (he1 != NULL) ? he1->h_aliases : he2->h_aliases;
cpp = (he1 != NULL) ? he1->h_aliases
: ((he2 != NULL) ? he2->h_aliases : NULL);
while (*cpp != NULL) {
len = strlen (*cpp) + 1;
*npp = malloc(len);