Commit 435634ae authored by Erik Hovland's avatar Erik Hovland

Make sure the input device is closed on failure.

In the error path, the dvd input device is not cleaned when the error
path is traversed.
parent 88b52804
......@@ -741,6 +741,7 @@ static dvd_file_t *DVDOpenFilePath( dvd_reader_t *dvd, char *filename )
if( stat( full_path, &fileinfo ) < 0 ) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
free( dvd_file );
dvdinput_close( dev );
return NULL;
}
dvd_file->title_sizes[ 0 ] = fileinfo.st_size / DVD_VIDEO_LB_LEN;
......
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