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
4ad069f6
Commit
4ad069f6
authored
Feb 14, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LUA: fix memory leaks in error path
parent
c7eabcd9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
27 deletions
+20
-27
modules/misc/lua/vlc.c
modules/misc/lua/vlc.c
+20
-27
No files found.
modules/misc/lua/vlc.c
View file @
4ad069f6
...
@@ -150,42 +150,35 @@ static int file_compare( const char **a, const char **b )
...
@@ -150,42 +150,35 @@ static int file_compare( const char **a, const char **b )
return
strcmp
(
*
a
,
*
b
);
return
strcmp
(
*
a
,
*
b
);
}
}
int
vlclua_dir_list
(
vlc_object_t
*
p_this
,
const
char
*
luadirname
,
char
**
ppsz_dir_list
)
int
vlclua_dir_list
(
vlc_object_t
*
p_this
,
const
char
*
luadirname
,
char
**
ppsz_dir_list
)
{
{
int
i
=
0
;
int
i
=
0
;
char
*
datadir
=
config_GetUserDir
(
VLC_DATA_DIR
);
char
*
datadir
=
config_GetUserDir
(
VLC_DATA_DIR
);
if
(
datadir
==
NULL
)
return
VLC_ENOMEM
;
if
(
asprintf
(
&
ppsz_dir_list
[
i
],
"%s"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
if
(
likely
(
datadir
!=
NULL
)
datadir
,
luadirname
)
<
0
)
&&
likely
(
asprintf
(
&
ppsz_dir_list
[
i
],
"%s"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
{
datadir
,
luadirname
)
!=
-
1
)
)
free
(
datadir
);
return
VLC_ENOMEM
;
}
free
(
datadir
);
i
++
;
i
++
;
free
(
datadir
);
char
*
psz_datapath
=
config_GetDataDir
(
p_this
);
char
*
psz_datapath
=
config_GetDataDir
(
p_this
);
# if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32
)
if
(
likely
(
psz_datapath
!=
NULL
)
)
{
{
if
(
asprintf
(
&
ppsz_dir_list
[
i
],
"%s"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
if
(
likely
(
asprintf
(
&
ppsz_dir_list
[
i
],
"%s"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
psz_datapath
,
luadirname
)
<
0
)
psz_datapath
,
luadirname
)
!=
-
1
)
)
return
VLC_ENOMEM
;
i
++
;
if
(
asprintf
(
&
ppsz_dir_list
[
i
],
"%s"
DIR_SEP
"share"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
psz_datapath
,
luadirname
)
<
0
)
return
VLC_ENOMEM
;
i
++
;
i
++
;
}
#if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
# else
if
(
likely
(
asprintf
(
&
ppsz_dir_list
[
i
],
if
(
asprintf
(
&
ppsz_dir_list
[
i
],
"%s"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
"%s"
DIR_SEP
"share"
DIR_SEP
"lua"
DIR_SEP
"%s"
,
psz_datapath
,
luadirname
)
<
0
)
psz_datapath
,
luadirname
)
!=
-
1
)
)
return
VLC_ENOMEM
;
i
++
;
i
++
;
#
endif
#endif
free
(
psz_datapath
);
free
(
psz_datapath
);
}
ppsz_dir_list
[
i
]
=
NULL
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
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