cap_unwrap should return a descriptor but also free the structure.

This commit is contained in:
oshogbo 2018-01-04 08:23:23 +00:00
parent 458d43ec50
commit 6fceb757ff

View File

@ -122,7 +122,15 @@ cap_wrap(int sock)
#ifdef WITH_CASPER
int cap_unwrap(cap_channel_t *chan);
#else
#define cap_unwrap(chan) (chan->cch_fd)
static inline int
cap_unwrap(cap_channel_t *chan)
{
int fd;
fd = chan->cch_fd;
free(chan);
return (fd);
}
#endif
/*