From: Stefan Fritsch Date: Tue, 3 Aug 2010 19:36:03 +0000 (+0000) Subject: set free()d pointers to NULL to avoid potential use-after-free bugs X-Git-Tag: 2.3.7~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3490c3c66d6aeff0eb0022c9154744b6856ffd8;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 7ec5adf7953..5fa013b11b1 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; }