Commit 3d52c5d8 authored by Pekka Pessi's avatar Pekka Pessi

tport.c: check for socket() success in bind6only_check()

MeeGo Coverity issue CID#7588
parent 28ac595c
......@@ -1754,6 +1754,11 @@ int bind6only_check(tport_master_t *mr)
s4 = su_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
s6 = su_socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
if (s4 == INVALID_SOCKET || s6 == INVALID_SOCKET) {
retval = -1;
goto cleanup;
}
memset(su, 0, sizeof *su);
su->su_len = sulen = (sizeof su->su_sin6);
su->su_family = AF_INET6;
......@@ -1770,10 +1775,11 @@ int bind6only_check(tport_master_t *mr)
bind(s4, &su4->su_sa, su4len) == 0)
retval = 1;
su_close(s6), su_close(s4);
mr->mr_bindv6only = retval;
mr->mr_boundserver = 1;
cleanup:
su_close(s6), su_close(s4);
#endif
return retval;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment