File descriptor leak in libcam

Scott Long scottl at samsco.org
Sat Apr 29 23:47:51 UTC 2006


Joe Marcus Clarke wrote:
> There is a leak in the cam_lookup_pass() if the ioctl call fails to find
> the passthru device.  Basically, the xpt file descriptor will not be
> closed.  Can anyone give me permission to commit the following patch?
> Thanks.
> 
> http://www.marcuscom.com/downloads/camlib.c.diff
> 
> Joe
> 

Looks good to me.  Style-wise, I'd have it close the fd before
testing the return of the ioctl, but that's minor.

Scott



More information about the freebsd-current mailing list