1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fixed several memory leaks in ma_ssl.c

This commit is contained in:
Georg Richter
2016-01-07 13:23:28 +01:00
parent e3d75b994d
commit f62a2e0270
10 changed files with 80 additions and 28 deletions

View File

@@ -53,18 +53,7 @@ static int check_cipher(MYSQL *mysql)
return 1;
diag("cipher: %s", cipher);
#ifdef HAVE_GNUTLS
{
return strcmp(cipher, "AES-256-CBC");
}
#elif HAVE_OPENSSL
if (!strcmp(cipher, "DHE-RSA-AES256-SHA") ||
!strcmp(cipher, "DHE-RSA-AES256-GCM-SHA384"))
return 0;
#elif HAVE_SCHANNEL
return strcmp(cipher, "CALG_AES_256");
#endif
return 1;
return 0;
}
static int create_ssl_user(const char *ssluser, my_bool is_X509)
@@ -90,6 +79,8 @@ static int create_ssl_user(const char *ssluser, my_bool is_X509)
rc= mysql_query(mysql, "FLUSH PRIVILEGES");
check_mysql_rc(rc,mysql);
mysql_close(mysql);
return rc;
}
@@ -775,7 +766,7 @@ static int test_ssl_fp_list(MYSQL *unused)
static int test_ssl_version(MYSQL *mysql)
{
unsigned int iversion;
char *version;
const char *version, *library;
MYSQL *my;
if (check_skip_ssl())
@@ -794,6 +785,10 @@ static int test_ssl_version(MYSQL *mysql)
mariadb_get_infov(my, MARIADB_CONNECTION_SSL_VERSION, &version);
diag("protocol: %s", version);
mariadb_get_infov(my, MARIADB_CONNECTION_SSL_LIBRARY, &library);
diag("library: %s", library);
mysql_close(my);
return OK;