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

Noriko Hosoi (nhosoi) fedora-directory-commits at redhat.com
Fri Jan 11 18:39:13 UTC 2008


Author: nhosoi

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

Modified Files:
      Tag: Directory71RtmBranch
	ptpreop.c 
Log Message:
Resolves: #176302
Summary: crash in PTA plugin when bind returned controls
Description: applied the patch to Directory71RtmBranch



Index: ptpreop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/passthru/ptpreop.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- ptpreop.c	19 Apr 2005 22:07:31 -0000	1.4
+++ ptpreop.c	11 Jan 2008 18:39:10 -0000	1.4.2.1
@@ -143,7 +143,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;
@@ -253,7 +253,8 @@
 	 * Send a result to our client.
 	 */
 	if ( resctrls != NULL ) {
-	    (void)slapi_pblock_set( pb, SLAPI_RESCONTROLS, &resctrls );
+	    (void)slapi_pblock_set( pb, SLAPI_RESCONTROLS, resctrls );
+	    freeresctrls=0;
 	}
 	slapi_send_ldap_result( pb, rc, matcheddn, errmsg, 0, urls );
     }
@@ -270,7 +271,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