Skip to content

Commit

Permalink
inet: Close socket when leaving function early
Browse files Browse the repository at this point in the history
The socket is not closed when we hit the error path.

Reported by coverity.
  • Loading branch information
Daniel Wagner authored and pfl committed Nov 27, 2013
1 parent 2f00994 commit cf09d7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/inet.c
Expand Up @@ -1457,8 +1457,10 @@ static int ndisc_send_unspec(int type, int oif, const struct in6_addr *dest,
} else if (type == ND_NEIGHBOR_SOLICIT) {
datalen = sizeof(frame.i.ns); /* 24, csum() safe */
memcpy(&frame.i.ns.nd_ns_target, buf, sizeof(struct in6_addr));
} else
} else {
close(fd);
return -EINVAL;
}

dst.sin6_addr = *dest;

Expand Down

0 comments on commit cf09d7c

Please sign in to comment.