Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
mbedtls
Commits
f81088bb
Commit
f81088bb
authored
Feb 17, 2015
by
Mansour Moufid
Browse files
Fix a potential memory leak found by find-mem-leak.cocci.
parent
961c626d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
library/ssl_tls.c
library/ssl_tls.c
+6
-1
No files found.
library/ssl_tls.c
View file @
f81088bb
...
...
@@ -4063,8 +4063,13 @@ int ssl_set_psk( ssl_context *ssl, const unsigned char *psk, size_t psk_len,
ssl
->
psk
=
polarssl_malloc
(
ssl
->
psk_len
);
ssl
->
psk_identity
=
polarssl_malloc
(
ssl
->
psk_identity_len
);
if
(
ssl
->
psk
==
NULL
||
ssl
->
psk_identity
==
NULL
)
if
(
ssl
->
psk
==
NULL
)
return
(
POLARSSL_ERR_SSL_MALLOC_FAILED
);
if
(
ssl
->
psk_identity
==
NULL
)
{
polarssl_free
(
ssl
->
psk
);
return
(
POLARSSL_ERR_SSL_MALLOC_FAILED
);
}
memcpy
(
ssl
->
psk
,
psk
,
ssl
->
psk_len
);
memcpy
(
ssl
->
psk_identity
,
psk_identity
,
ssl
->
psk_identity_len
);
...
...
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