[vlc-commits] rar: small code factor
Rémi Denis-Courmont
git at videolan.org
Sun Jul 26 14:38:50 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 26 12:31:07 2015 +0300| [66d665131ebae6ce263915c063100964313d41fe] | committer: Rémi Denis-Courmont
rar: small code factor
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=66d665131ebae6ce263915c063100964313d41fe
---
modules/access/rar/rar.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/modules/access/rar/rar.c b/modules/access/rar/rar.c
index 52022db..bec9576 100644
--- a/modules/access/rar/rar.c
+++ b/modules/access/rar/rar.c
@@ -364,28 +364,22 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file, unsigned int *pi_nbvol
has_next = 1;
if (vol != s)
stream_Delete(vol);
+ free(volume_mrl);
- if (!has_next || !pattern) {
- free(volume_mrl);
+ if (!has_next || !pattern)
return VLC_SUCCESS;
- }
/* Open next volume */
const int volume_index = pattern->start + volume_offset++;
- if (volume_index > pattern->stop) {
- free(volume_mrl);
+ if (volume_index > pattern->stop)
return VLC_SUCCESS;
- }
char *volume_base;
if (asprintf(&volume_base, "%s://%.*s",
s->psz_access,
- (int)(strlen(s->psz_path) - strlen(pattern->match)), s->psz_path) < 0) {
- free(volume_mrl);
+ (int)(strlen(s->psz_path) - strlen(pattern->match)), s->psz_path) < 0)
return VLC_SUCCESS;
- }
- free(volume_mrl);
if (pattern->start) {
if (asprintf(&volume_mrl, pattern->format, volume_base, volume_index) < 0)
volume_mrl = NULL;
More information about the vlc-commits
mailing list