nusb/cam: don't videoclose() when open failed

The fsdestroyfid() is called regardless if the open succeeded
or failed. This causes erroneous videoclose() when opening
the frame or video file while the camera is active.
This commit is contained in:
cinap_lenrek 2020-11-16 19:56:13 +01:00
parent fc36bf0711
commit e8111e517d

View file

@ -284,6 +284,8 @@ fsdestroyfid(Fid *fid)
{
ReadState *rs;
if(fid->omode == -1)
return;
rs = fid->aux;
if(rs != nil){
free(rs->buf);