You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2010/08/03 21:36:03 UTC

svn commit: r982011 - /httpd/httpd/trunk/modules/ldap/util_ldap.c

Author: sf
Date: Tue Aug  3 19:36:03 2010
New Revision: 982011

URL: http://svn.apache.org/viewvc?rev=982011&view=rev
Log:
set free()d pointers to NULL to avoid potential use-after-free bugs

Modified:
    httpd/httpd/trunk/modules/ldap/util_ldap.c

Modified: httpd/httpd/trunk/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=982011&r1=982010&r2=982011&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap.c Tue Aug  3 19:36:03 2010
@@ -206,9 +206,11 @@ static apr_status_t uldap_connection_cle
         /* 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_cle
         /* unlock this entry */
         uldap_connection_close(ldc);
 
-     }
+    }
 
     return APR_SUCCESS;
 }