forked from enlightenment/efl
Ecore_con: preventing _init_con_ssl_init_count to go below zero.
Summary: _init_con_ssl_init_count should not go below zero. This can occur if a developer mistakenly calls ssl shutdown before calling ssl init. So adding the check to prevent this. Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1925 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
7143bd7fb5
commit
6fedf6819a
|
@ -470,6 +470,13 @@ ecore_con_ssl_init(void)
|
|||
Ecore_Con_Ssl_Error
|
||||
ecore_con_ssl_shutdown(void)
|
||||
{
|
||||
/* _init_con_ssl_init_count should not go below zero. */
|
||||
if (_init_con_ssl_init_count < 1)
|
||||
{
|
||||
ERR("ecore_con_ssl_shutdown called without calling ecore_con_ssl_init.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!--_init_con_ssl_init_count)
|
||||
SSL_SUFFIX(_ecore_con_ssl_shutdown) ();
|
||||
|
||||
|
|
Loading…
Reference in New Issue