summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-06 10:17:11 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-06 11:57:45 +0000
commitec3dcdfba5c4ae701a3ae22f31bdd8849367e4b3 (patch)
treea2ddb48df907503f5525e2f8da1d60c80506a84b /sd
parent0ddae2167e7d52bf0f2bda323100f5ebb4ab3dc0 (diff)
coverity#736093 Argument cannot be negative
Change-Id: I54f703c1ce5af70c24ef0ad9d6fa6c717d0ecd37
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/remotecontrol/DiscoveryService.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index 26da31127c36..1919b60cd796 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -81,6 +81,11 @@ DiscoveryService::DiscoveryService()
// Old implementation for backward compatibility matter
mSocket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
+ if (mSocket == -1)
+ {
+ SAL_WARN("sd", "DiscoveryService: socket failed: " << errno);
+ return; // would be better to throw, but unsure if caller handles that
+ }
sockaddr_in aAddr;
memset(&aAddr, 0, sizeof(aAddr));