Message ID | 20201120200712.491219-5-tedd.an@intel.com |
---|---|
State | New |
Headers | show |
Series | [1/6] monitor: Fix potential memory leak | expand |
diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c index 4dde55786..7e777e29c 100644 --- a/profiles/network/bnep.c +++ b/profiles/network/bnep.c @@ -255,7 +255,11 @@ static gboolean bnep_setup_cb(GIOChannel *chan, GIOCondition cond, memset(&timeo, 0, sizeof(timeo)); timeo.tv_sec = 0; - setsockopt(sk, SOL_SOCKET, SO_RCVTIMEO, &timeo, sizeof(timeo)); + if (setsockopt(sk, SOL_SOCKET, SO_RCVTIMEO, &timeo, + sizeof(timeo)) < 0) { + error("bnep: Set setsockopt failed: %s", strerror(errno)); + goto failed; + }; sk = g_io_channel_unix_get_fd(session->io); if (bnep_connadd(sk, session->src, session->iface) < 0)