fix coverity issues
3388. [bug] Fixed several Coverity warnings. [RT #30996]
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user