[Fedora-directory-commits] ldapserver/ldap/servers/plugins/passthru ptpreop.c, 1.6, 1.7

Nathan Kinder (nkinder) fedora-directory-commits at redhat.com
Mon Oct 8 20:49:18 UTC 2007


Author: nkinder

Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/passthru
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1354

Modified Files:
	ptpreop.c 
Log Message:
Resolves: 176302
Summary: Avoid double free of controls in passthrough plugin.



Index: ptpreop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/passthru/ptpreop.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ptpreop.c	10 Nov 2006 23:45:04 -0000	1.6
+++ ptpreop.c	8 Oct 2007 20:49:16 -0000	1.7
@@ -148,7 +148,7 @@
 static int
 passthru_bindpreop( Slapi_PBlock *pb )
 {
-    int			rc, method;
+    int			rc, method, freeresctrls=1;
     char		*normbinddn, *matcheddn;
     char		*libldap_errmsg, *pr_errmsg, *errmsg;
     PassThruConfig	*cfg;
@@ -259,6 +259,7 @@
 	 */
 	if ( resctrls != NULL ) {
 	    (void)slapi_pblock_set( pb, SLAPI_RESCONTROLS, resctrls );
+            freeresctrls=0;
 	}
 	slapi_send_ldap_result( pb, rc, matcheddn, errmsg, 0, urls );
     }
@@ -275,7 +276,7 @@
     if ( pr_errmsg != NULL ) {
 	PR_smprintf_free( pr_errmsg );
     }
-    if ( resctrls != NULL ) {
+    if ( freeresctrls && (resctrls != NULL) ) {
 	ldap_controls_free( resctrls );
     }
     if ( matcheddn != NULL ) {




More information about the Fedora-directory-commits mailing list