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
fb96d6f7
Commit
fb96d6f7
authored
Dec 09, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: Don't leak dataDir and configDir in dirs_macos.
parent
429cc2d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
src/config/dirs_macos.c
src/config/dirs_macos.c
+16
-3
No files found.
src/config/dirs_macos.c
View file @
fb96d6f7
...
@@ -32,15 +32,27 @@
...
@@ -32,15 +32,27 @@
#include <vlc_charset.h>
#include <vlc_charset.h>
#include <vlc_configuration.h>
#include <vlc_configuration.h>
static
char
*
configdir
=
NULL
;
static
char
*
datadir
=
NULL
;
static
pthread_once_t
once
=
PTHREAD_ONCE_INIT
;
static
void
init_dirs
(
void
)
{
configdir
=
config_GetUserDir
(
VLC_CONFIG_DIR
);
datadir
=
config_GetUserDir
(
VLC_DATA_DIR
);
}
const
char
*
config_GetConfDir
(
void
)
const
char
*
config_GetConfDir
(
void
)
{
{
return
config_GetUserDir
(
VLC_CONFIG_DIR
);
pthread_once
(
&
once
,
init_dirs
);
return
configdir
;
}
}
const
char
*
config_GetDataDir
(
void
)
const
char
*
config_GetDataDir
(
void
)
{
{
return
config_GetUserDir
(
VLC_DATA_DIR
);
pthread_once
(
&
once
,
init_dirs
);
return
datadir
;
}
}
static
char
*
config_GetHomeDir
(
void
)
static
char
*
config_GetHomeDir
(
void
)
...
@@ -56,7 +68,7 @@ static char *config_GetHomeDir (void)
...
@@ -56,7 +68,7 @@ static char *config_GetHomeDir (void)
char
*
config_GetUserDir
(
vlc_userdir_t
type
)
char
*
config_GetUserDir
(
vlc_userdir_t
type
)
{
{
char
*
psz_dir
;
char
*
psz_dir
;
c
onst
c
har
*
psz_parent
=
config_GetHomeDir
();
char
*
psz_parent
=
config_GetHomeDir
();
const
char
*
psz_path
;
const
char
*
psz_path
;
switch
(
type
)
switch
(
type
)
...
@@ -98,5 +110,6 @@ char *config_GetUserDir (vlc_userdir_t type)
...
@@ -98,5 +110,6 @@ char *config_GetUserDir (vlc_userdir_t type)
}
}
if
(
asprintf
(
&
psz_dir
,
psz_path
,
psz_parent
)
==
-
1
)
if
(
asprintf
(
&
psz_dir
,
psz_path
,
psz_parent
)
==
-
1
)
psz_dir
=
NULL
;
psz_dir
=
NULL
;
free
(
psz_parent
);
return
psz_dir
;
return
psz_dir
;
}
}
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