Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
libdvdcss
Commits
001afc48
Commit
001afc48
authored
Oct 25, 2014
by
Diego Biurrun
Browse files
libdvdcss: Refactor error handling in dvdcss_open()
parent
1ecbd379
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libdvdcss.c
View file @
001afc48
...
...
@@ -217,9 +217,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target )
{
print_error
(
dvdcss
,
"unknown decrypt method, please choose "
"from 'title', 'key' or 'disc'"
);
free
(
dvdcss
->
psz_device
);
free
(
dvdcss
);
return
NULL
;
goto
error
;
}
}
...
...
@@ -315,9 +313,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target )
i_ret
=
dvdcss_open_device
(
dvdcss
);
if
(
i_ret
<
0
)
{
free
(
dvdcss
->
psz_device
);
free
(
dvdcss
);
return
NULL
;
goto
error
;
}
dvdcss
->
b_scrambled
=
1
;
/* Assume the worst */
...
...
@@ -524,6 +520,11 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target )
dvdcss
->
pf_seek
(
dvdcss
,
0
);
return
dvdcss
;
error:
free
(
dvdcss
->
psz_device
);
free
(
dvdcss
);
return
NULL
;
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment