Commit 1d017a36 authored by Dong Anyuan's avatar Dong Anyuan

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

parent 65d16814
......@@ -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