Commit e99f87b1 authored by Dong Anyuan's avatar Dong Anyuan

Fix Coverity Scan CID 60372 (Handle variable sd going out of scope leaks the handle.)

parent b9b6ae2f
......@@ -764,6 +764,10 @@ static int sctp_create_new_listener(
if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &event,
sizeof(struct sctp_event_subscribe)) < 0) {
SCTP_ERROR("setsockopt: %s:%d\n", strerror(errno), errno);
if (sd != -1) {
close(sd);
sd = -1;
}
free(addr);
return -1;
}
......
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