Coverity issue 14317 (uninitialized status may influence execution flow)
Solution: restructure the flow when AquireSocket fails BUG=coverity:14317 TEST=trybot Review URL: https://webrtc-codereview.appspot.com/573006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2252 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -730,7 +730,6 @@ bool UdpSocket2Windows::SetQos(WebRtc_Word32 serviceType,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QOS Qos;
|
QOS Qos;
|
||||||
WebRtc_Word32 result ;
|
|
||||||
DWORD BytesRet;
|
DWORD BytesRet;
|
||||||
QOS_DESTADDR QosDestaddr;
|
QOS_DESTADDR QosDestaddr;
|
||||||
|
|
||||||
@@ -802,14 +801,14 @@ bool UdpSocket2Windows::SetQos(WebRtc_Word32 serviceType,
|
|||||||
Qos.ProviderSpecific.buf = (char*)&QosDestaddr;
|
Qos.ProviderSpecific.buf = (char*)&QosDestaddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AquireSocket())
|
if(!AquireSocket()) {
|
||||||
{
|
return false;
|
||||||
// To set QoS with SIO_SET_QOS the socket must be locally bound first
|
|
||||||
// or the call will fail with error code 10022.
|
|
||||||
result = WSAIoctl(GetFd(), SIO_SET_QOS, &Qos, sizeof(QOS), NULL, 0,
|
|
||||||
&BytesRet, NULL,NULL);
|
|
||||||
ReleaseSocket();
|
|
||||||
}
|
}
|
||||||
|
// To set QoS with SIO_SET_QOS the socket must be locally bound first
|
||||||
|
// or the call will fail with error code 10022.
|
||||||
|
WebRtc_Word32 result = WSAIoctl(GetFd(), SIO_SET_QOS, &Qos, sizeof(QOS),
|
||||||
|
NULL, 0, &BytesRet, NULL,NULL);
|
||||||
|
ReleaseSocket();
|
||||||
if (result == SOCKET_ERROR)
|
if (result == SOCKET_ERROR)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceTransport, _id,
|
WEBRTC_TRACE(kTraceError, kTraceTransport, _id,
|
||||||
|
|||||||
Reference in New Issue
Block a user