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
49bca36d
Commit
49bca36d
authored
Nov 10, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use free() instead of LocaleFree() for utf8_readdir() result
parent
e1e9924a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
19 deletions
+22
-19
include/charset.h
include/charset.h
+1
-1
include/vlc_symbols.h
include/vlc_symbols.h
+1
-1
modules/control/http/util.c
modules/control/http/util.c
+1
-1
modules/gui/ncurses.c
modules/gui/ncurses.c
+2
-2
modules/misc/gnutls.c
modules/misc/gnutls.c
+4
-4
src/misc/unicode.c
src/misc/unicode.c
+13
-10
No files found.
include/charset.h
View file @
49bca36d
...
...
@@ -40,7 +40,7 @@ VLC_EXPORT( char *, ToLocale, ( const char * ) );
VLC_EXPORT
(
int
,
utf8_open
,
(
const
char
*
filename
,
int
flags
,
mode_t
mode
)
);
VLC_EXPORT
(
FILE
*
,
utf8_fopen
,
(
const
char
*
filename
,
const
char
*
mode
)
);
VLC_EXPORT
(
void
*
,
utf8_opendir
,
(
const
char
*
dirname
)
);
VLC_EXPORT
(
c
onst
c
har
*
,
utf8_readdir
,
(
void
*
dir
)
);
VLC_EXPORT
(
char
*
,
utf8_readdir
,
(
void
*
dir
)
);
VLC_EXPORT
(
int
,
utf8_scandir
,
(
const
char
*
dirname
,
char
***
namelist
,
int
(
*
select
)(
const
char
*
),
int
(
*
compar
)(
const
char
**
,
const
char
**
)
)
);
VLC_EXPORT
(
int
,
utf8_stat
,
(
const
char
*
filename
,
void
*
buf
)
);
VLC_EXPORT
(
int
,
utf8_lstat
,
(
const
char
*
filename
,
void
*
buf
)
);
...
...
include/vlc_symbols.h
View file @
49bca36d
...
...
@@ -468,7 +468,7 @@ struct module_symbols_t
void
*
vlc_HashRetrieve_deprecated
;
void
*
(
*
utf8_opendir_inner
)
(
const
char
*
dirname
);
FILE
*
(
*
utf8_fopen_inner
)
(
const
char
*
filename
,
const
char
*
mode
);
c
onst
c
har
*
(
*
utf8_readdir_inner
)
(
void
*
dir
);
char
*
(
*
utf8_readdir_inner
)
(
void
*
dir
);
int
(
*
utf8_stat_inner
)
(
const
char
*
filename
,
void
*
buf
);
int
(
*
utf8_lstat_inner
)
(
const
char
*
filename
,
void
*
buf
);
char
*
(
*
FromLocaleDup_inner
)
(
const
char
*
);
...
...
modules/control/http/util.c
View file @
49bca36d
...
...
@@ -206,7 +206,7 @@ int E_(ParseDirectory)( intf_thread_t *p_intf, char *psz_root,
continue
;
sprintf
(
dir
,
"%s%c%s"
,
psz_dir
,
sep
,
psz_filename
);
LocaleF
ree
(
psz_filename
);
f
ree
(
psz_filename
);
if
(
E_
(
ParseDirectory
)(
p_intf
,
psz_root
,
dir
)
)
{
...
...
modules/gui/ncurses.c
View file @
49bca36d
...
...
@@ -1945,7 +1945,7 @@ static void ReadDir( intf_thread_t *p_intf )
(
strlen
(
psz_entry
)
&&
psz_entry
[
0
]
==
'.'
)
&&
strcmp
(
psz_entry
,
".."
)
)
{
LocaleF
ree
(
psz_entry
);
f
ree
(
psz_entry
);
psz_entry
=
utf8_readdir
(
p_current_dir
);
continue
;
}
...
...
@@ -1982,7 +1982,7 @@ static void ReadDir( intf_thread_t *p_intf )
}
free
(
psz_uri
);
LocaleF
ree
(
psz_entry
);
f
ree
(
psz_entry
);
/* Read next entry */
psz_entry
=
utf8_readdir
(
p_current_dir
);
}
...
...
modules/misc/gnutls.c
View file @
49bca36d
...
...
@@ -504,13 +504,13 @@ gnutls_Addx509Directory( vlc_object_t *p_this,
char
*
psz_filename
;
int
check
;
if
(
(
strcmp
(
"."
,
psz_dirent
)
==
0
)
if
(
(
psz_dirent
==
NULL
)
||
(
strcmp
(
"."
,
psz_dirent
)
==
0
)
||
(
strcmp
(
".."
,
psz_dirent
)
==
0
)
)
continue
;
check
=
asprintf
(
&
psz_filename
,
"%s/%s"
,
psz_dirname
,
psz_dirent
);
LocaleFree
(
psz_dirent
);
check
=
asprintf
(
&
psz_filename
,
"%s/%s"
,
psz_dirname
,
psz_dirent
);
free
(
psz_dirent
);
if
(
check
==
-
1
)
continue
;
...
...
src/misc/unicode.c
View file @
49bca36d
...
...
@@ -470,7 +470,10 @@ void *utf8_opendir( const char *dirname )
return
NULL
;
}
const
char
*
utf8_readdir
(
void
*
dir
)
#define darwin_readdir_fix( a ) __vlc_fix_readdir_charset (NULL, a)
char
*
utf8_readdir
(
void
*
dir
)
{
struct
dirent
*
ent
;
...
...
@@ -478,7 +481,11 @@ const char *utf8_readdir( void *dir )
if
(
ent
==
NULL
)
return
NULL
;
return
FromLocale
(
ent
->
d_name
);
#ifdef __APPLE__
return
darwin_readdir_fix
(
ent
->
d_name
);
#else
return
strdup
(
ent
->
d_name
);
#endif
}
static
int
dummy_select
(
const
char
*
str
)
...
...
@@ -507,25 +514,21 @@ int utf8_scandir( const char *dirname, char ***namelist,
while
(
(
entry
=
utf8_readdir
(
dir
)
)
!=
NULL
)
{
char
**
newtab
;
char
*
utf_entry
=
strdup
(
entry
);
LocaleFree
(
entry
);
if
(
utf_entry
==
NULL
)
goto
error
;
if
(
!
select
(
utf_
entry
)
)
if
(
!
select
(
entry
)
)
{
free
(
utf_
entry
);
free
(
entry
);
continue
;
}
newtab
=
realloc
(
tab
,
sizeof
(
char
*
)
*
(
num
+
1
)
);
if
(
newtab
==
NULL
)
{
free
(
utf_
entry
);
free
(
entry
);
goto
error
;
}
tab
=
newtab
;
tab
[
num
++
]
=
utf_
entry
;
tab
[
num
++
]
=
entry
;
}
vlc_closedir_wrapper
(
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