Again, r=me for fixing the problems.
But what I actually meant by "a wrapper function" was something like an
int rtp_send_file_impl(..., int *fd, FILE **in, ogg_sync_state *oy,
ogg_stream_state *os);
Then rtp_send_file() just calls rtp_send_file_impl(), and when it returns,
cleans up all of the resources. That guarantees you never miss a cleanup on
return (and never have a "goto fail" problem).

On 2016/06/14 08:40:51, derf wrote:
> Again, r=me for fixing the problems.
>
> But what I actually meant by "a wrapper function" was something like an
>
> int rtp_send_file_impl(..., int *fd, FILE **in, ogg_sync_state *oy,
> ogg_stream_state *os);
>
> Then rtp_send_file() just calls rtp_send_file_impl(), and when it returns,
> cleans up all of the resources. That guarantees you never miss a cleanup on
> return (and never have a "goto fail" problem).
Ah yes, one of *those* wrapper functions...