From c3490c3c66d6aeff0eb0022c9154744b6856ffd8 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch <sf@apache.org> Date: Tue, 3 Aug 2010 19:36:03 +0000 Subject: [PATCH] set free()d pointers to NULL to avoid potential use-after-free bugs git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982011 13f79535-47bb-0310-9956-ffa450edef68 --- modules/ldap/util_ldap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 7ec5adf795..5fa013b11b 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -206,9 +206,11 @@ static apr_status_t uldap_connection_cleanup(void *param) /* free the username and password */ if (ldc->bindpw) { free((void*)ldc->bindpw); + ldc->bindpw = NULL; } if (ldc->binddn) { free((void*)ldc->binddn); + ldc->binddn = NULL; } /* ldc->reason is allocated from r->pool */ if (ldc->reason) { @@ -217,7 +219,7 @@ static apr_status_t uldap_connection_cleanup(void *param) /* unlock this entry */ uldap_connection_close(ldc); - } + } return APR_SUCCESS; } -- 2.40.0