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
64ae53f4
Commit
64ae53f4
authored
Jan 12, 2016
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keystore: factor vlc_keystore_release_entry
parent
bd17fa57
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
17 deletions
+15
-17
include/vlc_keystore.h
include/vlc_keystore.h
+12
-0
modules/keystore/plaintext.c
modules/keystore/plaintext.c
+2
-11
src/misc/keystore.c
src/misc/keystore.c
+1
-6
No files found.
include/vlc_keystore.h
View file @
64ae53f4
...
...
@@ -267,6 +267,18 @@ vlc_keystore_entry_set_secret(vlc_keystore_entry *p_entry,
return
VLC_SUCCESS
;
}
static
inline
void
vlc_keystore_release_entry
(
vlc_keystore_entry
*
p_entry
)
{
for
(
unsigned
int
j
=
0
;
j
<
KEY_MAX
;
++
j
)
{
free
(
p_entry
->
ppsz_values
[
j
]);
p_entry
->
ppsz_values
[
j
]
=
NULL
;
}
free
(
p_entry
->
p_secret
);
p_entry
->
p_secret
=
NULL
;
}
typedef
struct
vlc_keystore_sys
vlc_keystore_sys
;
struct
vlc_keystore
{
...
...
modules/keystore/plaintext.c
View file @
64ae53f4
...
...
@@ -360,15 +360,7 @@ Store(vlc_keystore *p_keystore, const char *const ppsz_values[KEY_MAX],
vlc_keystore_entry
*
p_entry
=
list_get_entry
(
p_list
,
ppsz_values
,
NULL
);
if
(
p_entry
)
{
free
(
p_entry
->
p_secret
);
p_entry
->
p_secret
=
NULL
;
for
(
unsigned
int
i
=
0
;
i
<
KEY_MAX
;
++
i
)
{
free
(
p_entry
->
ppsz_values
[
i
]);
p_entry
->
ppsz_values
[
i
]
=
NULL
;
}
}
vlc_keystore_release_entry
(
p_entry
);
else
{
p_entry
=
list_new_entry
(
p_list
);
...
...
@@ -441,8 +433,7 @@ Remove(vlc_keystore *p_keystore, const char *const ppsz_values[KEY_MAX])
while
((
p_entry
=
list_get_entry
(
p_list
,
ppsz_values
,
&
i_index
)))
{
free
(
p_entry
->
p_secret
);
p_entry
->
p_secret
=
NULL
;
vlc_keystore_release_entry
(
p_entry
);
i_count
++
;
}
...
...
src/misc/keystore.c
View file @
64ae53f4
...
...
@@ -116,12 +116,7 @@ void
vlc_keystore_release_entries
(
vlc_keystore_entry
*
p_entries
,
unsigned
int
i_count
)
{
for
(
unsigned
int
i
=
0
;
i
<
i_count
;
++
i
)
{
vlc_keystore_entry
*
p_entry
=
&
p_entries
[
i
];
for
(
unsigned
int
j
=
0
;
j
<
KEY_MAX
;
++
j
)
free
(
p_entry
->
ppsz_values
[
j
]);
free
(
p_entry
->
p_secret
);
}
vlc_keystore_release_entry
(
&
p_entries
[
i
]);
free
(
p_entries
);
}
...
...
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