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
dc078f20
Commit
dc078f20
authored
Apr 16, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules: Fix const char * usage and memory management.
parent
9ad405aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
src/modules/modules.c
src/modules/modules.c
+4
-4
src/modules/modules.h
src/modules/modules.h
+4
-4
No files found.
src/modules/modules.c
View file @
dc078f20
...
@@ -1301,7 +1301,7 @@ static module_t * AllocatePlugin( vlc_object_t * p_this, char * psz_file )
...
@@ -1301,7 +1301,7 @@ static module_t * AllocatePlugin( vlc_object_t * p_this, char * psz_file )
*****************************************************************************/
*****************************************************************************/
static
void
DupModule
(
module_t
*
p_module
)
static
void
DupModule
(
module_t
*
p_module
)
{
{
c
onst
c
har
**
pp_shortcut
;
char
**
pp_shortcut
;
int
i_submodule
;
int
i_submodule
;
for
(
pp_shortcut
=
p_module
->
pp_shortcuts
;
*
pp_shortcut
;
pp_shortcut
++
)
for
(
pp_shortcut
=
p_module
->
pp_shortcuts
;
*
pp_shortcut
;
pp_shortcut
++
)
...
@@ -1311,7 +1311,8 @@ static void DupModule( module_t *p_module )
...
@@ -1311,7 +1311,8 @@ static void DupModule( module_t *p_module )
/* We strdup() these entries so that they are still valid when the
/* We strdup() these entries so that they are still valid when the
* module is unloaded. */
* module is unloaded. */
p_module
->
psz_object_name
=
strdup
(
p_module
->
psz_object_name
);
/* This one is a (const char *) that will never get freed. */
p_module
->
psz_object_name
=
p_module
->
psz_object_name
;
p_module
->
psz_capability
=
strdup
(
p_module
->
psz_capability
);
p_module
->
psz_capability
=
strdup
(
p_module
->
psz_capability
);
p_module
->
psz_shortname
=
p_module
->
psz_shortname
?
p_module
->
psz_shortname
=
p_module
->
psz_shortname
?
strdup
(
p_module
->
psz_shortname
)
:
NULL
;
strdup
(
p_module
->
psz_shortname
)
:
NULL
;
...
@@ -1332,7 +1333,7 @@ static void DupModule( module_t *p_module )
...
@@ -1332,7 +1333,7 @@ static void DupModule( module_t *p_module )
*****************************************************************************/
*****************************************************************************/
static
void
UndupModule
(
module_t
*
p_module
)
static
void
UndupModule
(
module_t
*
p_module
)
{
{
c
onst
c
har
**
pp_shortcut
;
char
**
pp_shortcut
;
int
i_submodule
;
int
i_submodule
;
for
(
i_submodule
=
0
;
i_submodule
<
p_module
->
i_children
;
i_submodule
++
)
for
(
i_submodule
=
0
;
i_submodule
<
p_module
->
i_children
;
i_submodule
++
)
...
@@ -1345,7 +1346,6 @@ static void UndupModule( module_t *p_module )
...
@@ -1345,7 +1346,6 @@ static void UndupModule( module_t *p_module )
free
(
*
pp_shortcut
);
free
(
*
pp_shortcut
);
}
}
free
(
p_module
->
psz_object_name
);
free
(
p_module
->
psz_capability
);
free
(
p_module
->
psz_capability
);
free
(
p_module
->
psz_shortname
);
free
(
p_module
->
psz_shortname
);
free
(
p_module
->
psz_longname
);
free
(
p_module
->
psz_longname
);
...
...
src/modules/modules.h
View file @
dc078f20
...
@@ -103,12 +103,12 @@ struct module_t
...
@@ -103,12 +103,12 @@ struct module_t
/*
/*
* Variables set by the module to identify itself
* Variables set by the module to identify itself
*/
*/
c
onst
c
har
*
psz_shortname
;
/**< Module name */
char
*
psz_shortname
;
/**< Module name */
c
onst
c
har
*
psz_longname
;
/**< Module descriptive name */
char
*
psz_longname
;
/**< Module descriptive name */
c
onst
c
har
*
psz_help
;
/**< Long help string for "special" modules */
char
*
psz_help
;
/**< Long help string for "special" modules */
/** Shortcuts to the module */
/** Shortcuts to the module */
c
onst
c
har
*
pp_shortcuts
[
MODULE_SHORTCUT_MAX
];
char
*
pp_shortcuts
[
MODULE_SHORTCUT_MAX
];
char
*
psz_capability
;
/**< Capability */
char
*
psz_capability
;
/**< Capability */
int
i_score
;
/**< Score for the capability */
int
i_score
;
/**< Score for the capability */
...
...
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