Skip to content

Commit 1a6595b

Browse files
author
Yashwant Sahu
committed
BUG#27040070 : ldap: asan and valgrind issues
Description: 1. Fixed memory leak in ldap sasl server plugin. 2. Fixed memory leak in ldap sasl client side plugin. 3. Suppressed false positive leaks. 4. Fixed test skip issue for el7. RB: 18860
1 parent 912bee4 commit 1a6595b

File tree

2 files changed

+148
-4
lines changed

2 files changed

+148
-4
lines changed

libmysql/authentication_ldap/auth_ldap_sasl_client.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ void Sasl_client::interact(sasl_interact_t *ilist)
3636
the name of the user authenticating
3737
*/
3838
case SASL_CB_USER:
39-
ilist->result= strdup(m_user_name);
39+
ilist->result= m_user_name;
4040
ilist->len= strlen((const char*)ilist->result);
4141
break;
4242
/* the name of the user acting for. (for example postman delivering mail for
4343
Martin might have an AUTHNAME of postman and a USER of Martin)
4444
*/
4545
case SASL_CB_AUTHNAME:
46-
ilist->result= strdup(m_user_name);
46+
ilist->result= m_user_name;
4747
ilist->len= strlen((const char*)ilist->result);
4848
break;
4949
case SASL_CB_PASS:
50-
ilist->result= strdup(m_user_pwd);
50+
ilist->result= m_user_pwd;
5151
ilist->len= strlen((const char*)ilist->result);
5252
break;
5353
default:

mysql-test/valgrind.supp

Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or
44
# modify it under the terms of the GNU Library General Public
@@ -1608,3 +1608,147 @@
16081608
fun:_ZL17plugin_initializeP13st_plugin_int
16091609
...
16101610
}
1611+
1612+
# Bug #25964438 LDAP: ASAN AND VALGRIND ISSUES
1613+
{
1614+
LDAP_TLS_workaround1
1615+
Memcheck:Leak
1616+
fun:calloc
1617+
...
1618+
...
1619+
...
1620+
...
1621+
...
1622+
fun:ldap_int_tls_start
1623+
fun:ldap_start_tls_s
1624+
fun:*establish_tls*
1625+
fun:*create*
1626+
}
1627+
{
1628+
LDAP_TLS_workaround2
1629+
Memcheck:Leak
1630+
fun:malloc
1631+
...
1632+
...
1633+
...
1634+
...
1635+
...
1636+
fun:ldap_int_tls_start
1637+
fun:ldap_start_tls_s
1638+
fun:*establish_tls*
1639+
fun:*create*
1640+
}
1641+
{
1642+
LDAP_TLS_workaround3
1643+
Memcheck:Leak
1644+
fun:calloc
1645+
fun:PR_LoadLibraryWithFlags
1646+
...
1647+
...
1648+
...
1649+
fun:PR_CallOnce
1650+
...
1651+
...
1652+
fun:_dl_init
1653+
}
1654+
{
1655+
LDAP_TLS_workaround4
1656+
Memcheck:Leak
1657+
fun:malloc
1658+
fun:PR_ErrorInstallTable
1659+
fun:PR_CallOnce
1660+
...
1661+
...
1662+
fun:PR_CallOnceWithArg
1663+
...
1664+
fun:NSS_SetDomesticPolicy
1665+
...
1666+
fun:PR_CallOnceWithArg
1667+
...
1668+
...
1669+
...
1670+
fun:ldap_int_tls_start
1671+
fun:ldap_start_tls_s
1672+
fun:*establish_tls*
1673+
}
1674+
{
1675+
LDAP_TLS_workaround5
1676+
Memcheck:Leak
1677+
fun:malloc
1678+
...
1679+
fun:PR_LoadLibraryWithFlags
1680+
...
1681+
...
1682+
...
1683+
fun:PR_CallOnce
1684+
...
1685+
...
1686+
...
1687+
...
1688+
fun:_dl_catch_error
1689+
fun:_dl_open
1690+
fun:dlopen_doit
1691+
fun:_dl_catch_error
1692+
fun:_dlerror_run
1693+
}
1694+
{
1695+
LDAP_TLS_workaround6
1696+
Memcheck:Leak
1697+
fun:malloc
1698+
fun:ber_memalloc_x
1699+
fun:ber_strdup_x
1700+
...
1701+
fun:ldap_int_initialize
1702+
fun:ldap_create
1703+
fun:ldap_initialize
1704+
fun:*create*
1705+
}
1706+
{
1707+
LDAP_TLS_workaround7
1708+
Memcheck:Leak
1709+
fun:malloc
1710+
fun:*dl_close_worker*
1711+
fun:*dl_close*
1712+
fun:*dl_catch_error*
1713+
fun:*libc_dlclose*
1714+
fun:*free_mem*
1715+
fun:*libc_freeres*
1716+
fun:*vgnU_freeres*
1717+
fun:*run_exit_handlers*
1718+
fun:exit*
1719+
fun:*mysqld_exit*
1720+
fun:*mysqld_main*
1721+
fun:*main*
1722+
}
1723+
{
1724+
LDAP_TLS_workaround8
1725+
Memcheck:Leak
1726+
fun:malloc
1727+
fun:ber_memalloc_x
1728+
fun:ber_strdup_x
1729+
...
1730+
fun:ldap_int_initialize
1731+
fun:ldap_set_option
1732+
fun:*configure_tls*
1733+
}
1734+
{
1735+
LDAP_TLS_workaround9
1736+
Memcheck:Leak
1737+
match-leak-kinds: reachable
1738+
fun:malloc
1739+
fun:PR_ErrorInstallTable
1740+
...
1741+
...
1742+
...
1743+
...
1744+
...
1745+
...
1746+
...
1747+
...
1748+
...
1749+
...
1750+
...
1751+
...
1752+
fun:ldap_int_tls_start
1753+
fun:ldap_start_tls_s
1754+
}

0 commit comments

Comments
 (0)