Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
2e6d37ed
Commit
2e6d37ed
authored
Oct 26, 2007
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix potential memleak.
parent
250b5a41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
src/misc/update.c
src/misc/update.c
+21
-19
No files found.
src/misc/update.c
View file @
2e6d37ed
...
@@ -1289,7 +1289,6 @@ void update_download_for_real( download_thread_t *p_this )
...
@@ -1289,7 +1289,6 @@ void update_download_for_real( download_thread_t *p_this )
}
}
else
else
{
{
p_file
=
utf8_fopen
(
psz_dest
,
"w"
);
p_file
=
utf8_fopen
(
psz_dest
,
"w"
);
if
(
!
p_file
)
if
(
!
p_file
)
{
{
...
@@ -1305,27 +1304,30 @@ void update_download_for_real( download_thread_t *p_this )
...
@@ -1305,27 +1304,30 @@ void update_download_for_real( download_thread_t *p_this )
l_size
=
stream_Size
(
p_stream
);
l_size
=
stream_Size
(
p_stream
);
p_buffer
=
(
void
*
)
malloc
(
1
<<
10
);
p_buffer
=
(
void
*
)
malloc
(
1
<<
10
);
if
(
p_buffer
)
while
(
(
l_read
=
stream_Read
(
p_stream
,
p_buffer
,
1
<<
10
)
)
)
{
{
float
f_progress
;
while
(
(
l_read
=
stream_Read
(
p_stream
,
p_buffer
,
1
<<
10
)
)
)
{
fwrite
(
p_buffer
,
l_read
,
1
,
p_file
);
float
f_progress
;
l_done
+=
l_read
;
fwrite
(
p_buffer
,
l_read
,
1
,
p_file
);
free
(
psz_status
);
f_progress
=
100
.
0
*
(
float
)
l_done
/
(
float
)
l_size
;
l_done
+=
l_read
;
psz_s1
=
size_str
(
l_done
);
free
(
psz_status
);
psz_s2
=
size_str
(
l_size
);
f_progress
=
100
.
0
*
(
float
)
l_done
/
(
float
)
l_size
;
asprintf
(
&
psz_status
,
"%s
\n
Downloading... %s/%s (%.1f%%) done"
,
psz_s1
=
size_str
(
l_done
);
p_this
->
psz_status
,
psz_s1
,
psz_s2
,
f_progress
);
psz_s2
=
size_str
(
l_size
);
free
(
psz_s1
);
free
(
psz_s2
);
asprintf
(
&
psz_status
,
"%s
\n
Downloading... %s/%s (%.1f%%) done"
,
p_this
->
psz_status
,
psz_s1
,
psz_s2
,
f_progress
);
free
(
psz_s1
);
free
(
psz_s2
);
intf_ProgressUpdate
(
p_libvlc
,
i_progress
,
psz_status
,
f_progress
,
0
);
}
intf_ProgressUpdate
(
p_libvlc
,
i_progress
,
free
(
p_buffer
);
psz_status
,
f_progress
,
0
);
}
}
free
(
p_buffer
);
fclose
(
p_file
);
fclose
(
p_file
);
stream_Delete
(
p_stream
);
stream_Delete
(
p_stream
);
...
...
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