GrumpyOldTroll / libmcrx

Multicast receive library.
Other
5 stars 2 forks source link

Unreachable code in mcrx_prv_remove_socket_cb() #14

Closed ghenry closed 2 years ago

ghenry commented 2 years ago

https://github.com/GrumpyOldTroll/libmcrx/blob/d178b6c8a99485e4f1224f34cac053ff7397048f/src/wait.c#L653

GrumpyOldTroll commented 2 years ago

Now that I got a chance to look at this, I'm pretty sure this code is missing a check in this loop looking something like:

    if (cur_cb->fd != fd) {
      continue;
    }

Not sure what you mean bby "unreachable" tho, is that results from a coverage run or static analysis or what?

ghenry commented 2 years ago

It just means it will never get run, like calling a function after you've done return 0; etc.