]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/extended.c
Fix C errors
[openldap] / servers / slapd / extended.c
index 60c50b07290d0d5d2816909ab5e35fca593ebc1d..38bb96c14734df866407e4b8faafe8b8fa9a6af4 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2006 The OpenLDAP Foundation.
+ * Copyright 1999-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -175,6 +175,18 @@ do_extended(
        op->o_bd = frontendDB;
        rs->sr_err = frontendDB->be_extended( op, rs );
 
+       /* clean up in case some overlay set them? */
+       if ( !BER_BVISNULL( &op->o_req_ndn ) ) {
+               if ( !BER_BVISNULL( &op->o_req_dn )
+                       && op->o_req_ndn.bv_val != op->o_req_dn.bv_val )
+               {
+                       op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
+               }
+               op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
+               BER_BVZERO( &op->o_req_dn );
+               BER_BVZERO( &op->o_req_ndn );
+       }
+
 done:
        return rs->sr_err;
 }
@@ -269,7 +281,7 @@ load_extop2(
                LDAP_SUCCESS )
        {
                oidm.bv_val = oidm_find( ext_oid->bv_val );
-               if ( ext_oid == NULL ) {
+               if ( oidm.bv_val == NULL ) {
                        return -1;
                }
                oidm.bv_len = strlen( oidm.bv_val );