Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
96591ab8
Commit
96591ab8
authored
Aug 23, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gnutls: fix memory leaks
(cherry picked from commit 2c753633d9bdc0266a831e9979cd5f2c06f31d61)
parent
67a098c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
modules/misc/gnutls.c
modules/misc/gnutls.c
+10
-4
No files found.
modules/misc/gnutls.c
View file @
96591ab8
...
...
@@ -654,7 +654,10 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
vlc_tls_creds_sys_t
*
sys
=
malloc
(
sizeof
(
*
sys
));
if
(
unlikely
(
sys
==
NULL
))
goto
error
;
{
gnutls_Deinit
();
return
VLC_ENOMEM
;
}
crd
->
sys
=
sys
;
crd
->
add_CA
=
gnutls_AddCA
;
...
...
@@ -670,7 +673,9 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
{
msg_Err
(
crd
,
"cannot allocate credentials: %s"
,
gnutls_strerror
(
val
));
goto
error
;
free
(
sys
);
gnutls_Deinit
();
return
VLC_ENOMEM
;
}
block_t
*
certblock
=
block_FilePath
(
cert
);
...
...
@@ -678,7 +683,7 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
{
msg_Err
(
crd
,
"cannot read certificate chain from %s: %s"
,
cert
,
vlc_strerror_c
(
errno
));
return
VLC_EGENERIC
;
goto
error
;
}
block_t
*
keyblock
=
block_FilePath
(
key
);
...
...
@@ -687,7 +692,7 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
msg_Err
(
crd
,
"cannot read private key from %s: %s"
,
key
,
vlc_strerror_c
(
errno
));
block_Release
(
certblock
);
return
VLC_EGENERIC
;
goto
error
;
}
gnutls_datum_t
pub
=
{
...
...
@@ -735,6 +740,7 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
return
VLC_SUCCESS
;
error:
gnutls_certificate_free_credentials
(
sys
->
x509_cred
);
free
(
sys
);
gnutls_Deinit
();
return
VLC_EGENERIC
;
...
...
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