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:
Srivardhan Hebbar 2015-02-04 14:09:24 +01:00 committed by Cedric BAIL
parent 7143bd7fb5
commit 6fedf6819a
1 changed files with 7 additions and 0 deletions

View File

@ -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) ();