Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
0fd329fd
Commit
0fd329fd
authored
Nov 18, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive: memory leak
parent
99caee42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
modules/access/archive/access.c
modules/access/archive/access.c
+16
-14
No files found.
modules/access/archive/access.c
View file @
0fd329fd
...
...
@@ -93,30 +93,32 @@ static int FindVolumes(access_t *p_access, struct archive *p_archive, const char
uint16_t
i_min
;
uint16_t
i_max
;
}
patterns
[]
=
{
{
".part1.rar"
,
".part%.1d.rar"
,
2
,
9
},
{
".part01.rar"
,
".part%.2d.rar"
,
2
,
99
},
{
".part001.rar"
,
".part%.3d.rar"
,
2
,
999
},
{
".001"
,
".%.3d"
,
2
,
999
},
{
".000"
,
".%.3d"
,
1
,
999
},
{
".part1.rar"
,
"
%.*s
.part%.1d.rar"
,
2
,
9
},
{
".part01.rar"
,
"
%.*s
.part%.2d.rar"
,
2
,
99
},
{
".part001.rar"
,
"
%.*s
.part%.3d.rar"
,
2
,
999
},
{
".001"
,
"
%.*s
.%.3d"
,
2
,
999
},
{
".000"
,
"
%.*s
.%.3d"
,
1
,
999
},
};
const
size_t
i_uri_size
=
strlen
(
psz_uri
);
const
int
i_patterns
=
ARRAY_SIZE
(
patterns
);
for
(
int
i
=
0
;
i
<
i_patterns
;
i
++
)
const
int
i_uri_size
=
strlen
(
psz_uri
);
const
size_t
i_patterns
=
ARRAY_SIZE
(
patterns
);
for
(
size_t
i
=
0
;
i
<
i_patterns
;
i
++
)
{
const
size_
t
i_match_size
=
strlen
(
patterns
[
i
].
psz_match
);
const
in
t
i_match_size
=
strlen
(
patterns
[
i
].
psz_match
);
if
(
i_uri_size
<
i_match_size
)
continue
;
if
(
!
strcmp
(
&
psz_uri
[
i_uri_size
-
i_match_size
],
patterns
[
i
].
psz_match
))
{
char
**
ppsz_files
=
malloc
(
sizeof
(
char
*
)
*
patterns
[
i
].
i_max
);
char
**
ppsz_files
=
x
malloc
(
sizeof
(
char
*
)
*
patterns
[
i
].
i_max
);
for
(
int
j
=
patterns
[
i
].
i_min
;
j
<
patterns
[
i
].
i_max
;
j
++
)
for
(
unsigned
j
=
patterns
[
i
].
i_min
;
j
<
patterns
[
i
].
i_max
;
j
++
)
{
char
*
psz_newuri
=
strdup
(
psz_uri
);
if
(
!
psz_newuri
||
!
sprintf
(
&
psz_newuri
[
i_uri_size
-
i_match_size
],
patterns
[
i
].
psz_format
,
j
))
char
*
psz_newuri
;
if
(
asprintf
(
&
psz_newuri
,
patterns
[
i
].
psz_format
,
i_uri_size
-
i_match_size
,
psz_uri
,
j
)
==
-
1
)
break
;
/* Probe URI */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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