[master] fix null deref in some DLZ modules

3691.	[contrib]	Address null pointer dereference in LDAP and
			MySQL DLZ modules.
This commit is contained in:
Evan Hunt 2013-12-14 11:05:58 -08:00
parent eade480b33
commit 5f8d6cec48
3 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,6 @@
3691. [contrib] Address null pointer dereference in LDAP and
MySQL DLZ modules.
3690. [bug] Iterative responses could be missed when the source
port for an upstream query was the same as the
listener port (53). [RT #34925]

View file

@ -1178,7 +1178,8 @@ dlz_destroy(void *dbdata) {
ldap_instance_t *db = (ldap_instance_t *)dbdata;
#if PTHREADS
/* cleanup the list of DBI's */
ldap_destroy_dblist((db_list_t *)(db->db));
if (db->db != NULL)
ldap_destroy_dblist((db_list_t *)(db->db));
#else /* PTHREADS */
if (db->db->dbconn != NULL)
ldap_unbind_s((LDAP *)(db->db->dbconn));

View file

@ -1069,7 +1069,8 @@ dlz_destroy(void *dbdata) {
mysql_instance_t *db = (mysql_instance_t *)dbdata;
#if PTHREADS
/* cleanup the list of DBI's */
mysql_destroy_dblist((db_list_t *)(db->db));
if (db->db != NULL)
mysql_destroy_dblist((db_list_t *)(db->db));
#else /* PTHREADS */
mysql_destroy(db);
#endif /* PTHREADS */