diff options
author | Nathan Kinder <nkinder@redhat.com> | 2007-10-08 20:49:16 +0000 |
---|---|---|
committer | Nathan Kinder <nkinder@redhat.com> | 2007-10-08 20:49:16 +0000 |
commit | b2c19f1defd3f4dce86625b64ce1181ecaf61e16 (patch) | |
tree | 5e30c72e09b60cb8fa3f602ab8b3408734e49539 /ldap | |
parent | 2d8252024690b6192149f00b72e1200890358153 (diff) | |
download | ds-b2c19f1defd3f4dce86625b64ce1181ecaf61e16.tar.gz ds-b2c19f1defd3f4dce86625b64ce1181ecaf61e16.tar.xz ds-b2c19f1defd3f4dce86625b64ce1181ecaf61e16.zip |
Resolves: 176302
Summary: Avoid double free of controls in passthrough plugin.
Diffstat (limited to 'ldap')
-rw-r--r-- | ldap/servers/plugins/passthru/ptpreop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ldap/servers/plugins/passthru/ptpreop.c b/ldap/servers/plugins/passthru/ptpreop.c index 86d83fb7..e5d43d3a 100644 --- a/ldap/servers/plugins/passthru/ptpreop.c +++ b/ldap/servers/plugins/passthru/ptpreop.c @@ -148,7 +148,7 @@ passthru_bindpreop_close( Slapi_PBlock *pb ) 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 @@ passthru_bindpreop( Slapi_PBlock *pb ) */ 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 @@ passthru_bindpreop( Slapi_PBlock *pb ) if ( pr_errmsg != NULL ) { PR_smprintf_free( pr_errmsg ); } - if ( resctrls != NULL ) { + if ( freeresctrls && (resctrls != NULL) ) { ldap_controls_free( resctrls ); } if ( matcheddn != NULL ) { |