Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
b9946d43
Commit
b9946d43
authored
Apr 08, 2015
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSL resource cleanup
Bug: 453883
parent
ebdea502
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
SSLSocket.c
src/SSLSocket.c
+20
-6
No files found.
src/SSLSocket.c
View file @
b9946d43
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
* Ian Craggs, Allan Stockdill-Mander - initial implementation
* Ian Craggs, Allan Stockdill-Mander - initial implementation
* Ian Craggs - fix for bug #409702
* Ian Craggs - fix for bug #409702
* Ian Craggs - allow compilation for OpenSSL < 1.0
* Ian Craggs - allow compilation for OpenSSL < 1.0
* Ian Craggs - fix for bug #453883
*******************************************************************************/
*******************************************************************************/
/**
/**
...
@@ -353,7 +354,6 @@ void SSL_destroy_mutex(ssl_mutex_type* mutex)
...
@@ -353,7 +354,6 @@ void SSL_destroy_mutex(ssl_mutex_type* mutex)
rc
=
CloseHandle
(
*
mutex
);
rc
=
CloseHandle
(
*
mutex
);
#else
#else
rc
=
pthread_mutex_destroy
(
mutex
);
rc
=
pthread_mutex_destroy
(
mutex
);
free
(
mutex
);
#endif
#endif
FUNC_EXIT_RC
(
rc
);
FUNC_EXIT_RC
(
rc
);
}
}
...
@@ -382,10 +382,13 @@ extern unsigned long SSLThread_id(void)
...
@@ -382,10 +382,13 @@ extern unsigned long SSLThread_id(void)
extern
void
SSLLocks_callback
(
int
mode
,
int
n
,
const
char
*
file
,
int
line
)
extern
void
SSLLocks_callback
(
int
mode
,
int
n
,
const
char
*
file
,
int
line
)
{
{
if
(
sslLocks
)
{
if
(
mode
&
CRYPTO_LOCK
)
if
(
mode
&
CRYPTO_LOCK
)
SSL_lock_mutex
(
&
sslLocks
[
n
]);
SSL_lock_mutex
(
&
sslLocks
[
n
]);
else
else
SSL_unlock_mutex
(
&
sslLocks
[
n
]);
SSL_unlock_mutex
(
&
sslLocks
[
n
]);
}
}
}
int
SSLSocket_initialize
()
int
SSLSocket_initialize
()
...
@@ -442,7 +445,18 @@ exit:
...
@@ -442,7 +445,18 @@ exit:
void
SSLSocket_terminate
()
void
SSLSocket_terminate
()
{
{
FUNC_ENTRY
;
FUNC_ENTRY
;
EVP_cleanup
();
ERR_free_strings
();
if
(
sslLocks
)
{
int
i
=
0
;
for
(
i
=
0
;
i
<
CRYPTO_num_locks
();
i
++
)
{
SSL_destroy_mutex
(
&
sslLocks
[
i
]);
}
free
(
sslLocks
);
free
(
sslLocks
);
}
FUNC_EXIT
;
FUNC_EXIT
;
}
}
...
...
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