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
6ae117da
Commit
6ae117da
authored
Feb 27, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: fix potentially leaked error message
parent
99fffd13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
lib/error.c
lib/error.c
+15
-12
No files found.
lib/error.c
View file @
6ae117da
...
...
@@ -30,8 +30,10 @@ static const char oom[] = "Out of memory";
/* TODO: use only one thread-specific key for whole libvlc */
static
vlc_threadvar_t
context
;
static
vlc_mutex_t
lock
=
VLC_STATIC_MUTEX
;
static
uintptr_t
refs
=
0
;
static
char
*
get_error
(
void
)
{
return
vlc_threadvar_get
(
context
);
}
static
void
free_msg
(
void
*
msg
)
{
...
...
@@ -39,6 +41,14 @@ static void free_msg (void *msg)
free
(
msg
);
}
static
void
free_error
(
void
)
{
free_msg
(
get_error
());
}
static
vlc_mutex_t
lock
=
VLC_STATIC_MUTEX
;
static
uintptr_t
refs
=
0
;
void
libvlc_threads_init
(
void
)
{
vlc_mutex_lock
(
&
lock
);
...
...
@@ -52,20 +62,13 @@ void libvlc_threads_deinit (void)
vlc_mutex_lock
(
&
lock
);
assert
(
refs
>
0
);
if
(
--
refs
==
0
)
{
free_error
();
vlc_threadvar_delete
(
&
context
);
}
vlc_mutex_unlock
(
&
lock
);
}
static
char
*
get_error
(
void
)
{
return
vlc_threadvar_get
(
context
);
}
static
void
free_error
(
void
)
{
free_msg
(
get_error
());
}
/**
* Gets a human-readable error message for the last LibVLC error in the calling
* thread. The resulting string is valid until another error occurs (at least
...
...
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