Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
dc8116dc
Commit
dc8116dc
authored
Apr 23, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/playlist/item.c,item-ext.c: fixed memory leaks.
parent
7fc9581c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
60 deletions
+14
-60
src/playlist/item-ext.c
src/playlist/item-ext.c
+8
-60
src/playlist/item.c
src/playlist/item.c
+6
-0
No files found.
src/playlist/item-ext.c
View file @
dc8116dc
...
...
@@ -57,8 +57,6 @@ int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
playlist_item_t
*
p_item
=
playlist_ItemNew
(
p_playlist
,
psz_uri
,
psz_name
);
int
i
;
if
(
p_item
==
NULL
)
{
msg_Err
(
p_playlist
,
"unable to add item to playlist"
);
...
...
@@ -66,22 +64,20 @@ int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
}
p_item
->
input
.
i_duration
=
i_duration
;
p_item
->
input
.
i_options
=
i_options
;
p_item
->
input
.
ppsz_options
=
NULL
;
for
(
i
=
0
;
i
<
i_options
;
i
++
)
for
(
p_item
->
input
.
i_options
=
0
;
p_item
->
input
.
i_options
<
i_options
;
p_item
->
input
.
i_options
++
)
{
if
(
i
==
0
)
if
(
!
p_item
->
input
.
i_options
)
{
p_item
->
input
.
ppsz_options
=
malloc
(
i_options
*
sizeof
(
char
*
)
);
if
(
!
p_item
->
input
.
ppsz_options
)
{
p_item
->
input
.
i_options
=
0
;
break
;
}
if
(
!
p_item
->
input
.
ppsz_options
)
break
;
}
p_item
->
input
.
ppsz_options
[
i
]
=
strdup
(
ppsz_options
[
i
]
);
p_item
->
input
.
ppsz_options
[
p_item
->
input
.
i_options
]
=
strdup
(
ppsz_options
[
p_item
->
input
.
i_options
]
);
}
return
playlist_AddItem
(
p_playlist
,
p_item
,
i_mode
,
i_pos
);
...
...
@@ -374,57 +370,9 @@ int playlist_Delete( playlist_t * p_playlist, int i_pos )
msg_Dbg
(
p_playlist
,
"deleting playlist item `%s'"
,
p_item
->
input
.
psz_name
);
#if 0
int i,j;
vlc_mutex_lock( &p_item->lock );
if( p_item->psz_name )
{
free( p_item->psz_name );
}
if( p_item->psz_uri )
{
free( p_item->psz_uri );
}
/* Free the info categories. Welcome to the segfault factory */
if( p_item->i_categories > 0 )
{
for( i = 0; i < p_item->i_categories; i++ )
{
for( j= 0 ; j < p_item->pp_categories[i]->i_infos; j++)
{
if( p_item->pp_categories[i]->pp_infos[j]->psz_name)
{
free( p_item->pp_categories[i]->
pp_infos[j]->psz_name);
}
if( p_item->pp_categories[i]->pp_infos[j]->psz_value)
{
free( p_item->pp_categories[i]->
pp_infos[j]->psz_value);
}
free( p_item->pp_categories[i]->pp_infos[j] );
}
if( p_item->pp_categories[i]->i_infos )
free( p_item->pp_categories[i]->pp_infos );
if( p_item->pp_categories[i]->psz_name)
{
free( p_item->pp_categories[i]->psz_name );
}
free( p_item->pp_categories[i] );
}
free( p_item->pp_categories );
}
/* XXX: what if the item is still in use? */
#endif
playlist_ItemDelete
(
p_item
);
#if 0
free( p_item );
#endif
if
(
i_pos
<=
p_playlist
->
i_index
)
{
p_playlist
->
i_index
--
;
...
...
src/playlist/item.c
View file @
dc8116dc
...
...
@@ -110,6 +110,12 @@ void playlist_ItemDelete( playlist_item_t *p_item )
free
(
p_item
->
input
.
pp_categories
);
}
for
(
;
p_item
->
input
.
i_options
>
0
;
p_item
->
input
.
i_options
--
)
{
free
(
p_item
->
input
.
ppsz_options
[
p_item
->
input
.
i_options
-
1
]
);
if
(
p_item
->
input
.
i_options
==
1
)
free
(
p_item
->
input
.
ppsz_options
);
}
vlc_mutex_unlock
(
&
p_item
->
input
.
lock
);
vlc_mutex_destroy
(
&
p_item
->
input
.
lock
);
...
...
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