Commit 54c4660e authored by Petri Hintukainen's avatar Petri Hintukainen

dvdinput_close(): fix leak in error path

Memory should be freed even if DVDCSS_close() or close() returns an error.
Error return value is only for diagnostics; those functions can't be called again.
=> dvdinput_close() can't be called again.
parent 32c6f60f
......@@ -158,12 +158,9 @@ static int css_close(dvd_input_t dev)
ret = DVDcss_close(dev->dvdcss);
if(ret < 0)
return ret;
free(dev);
return 0;
return ret;
}
/**
......@@ -278,12 +275,9 @@ static int file_close(dvd_input_t dev)
ret = close(dev->fd);
if(ret < 0)
return ret;
free(dev);
return 0;
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment