Skip to content

Commit

Permalink
uevent_sender: Fix fd leak in sendmsg_one
Browse files Browse the repository at this point in the history
If connecting to the uevent socket fails, close the socket.
  • Loading branch information
martinpitt committed Jan 20, 2023
1 parent bdbdb07 commit d38d1d9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/uevent_sender.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ sendmsg_one(struct iovec *iov, size_t iov_len, const char *path)
if (errno == ECONNREFUSED) {
/* client side closed its monitor underneath us, so clean up and ignore */
unlink(event_addr.sun_path);
close(fd);
return;
}
perror("sendmsg_one: cannot connect to client's event socket");
Expand Down

0 comments on commit d38d1d9

Please sign in to comment.