]> git.sur5r.net Git - openldap/blobdiff - clients/tools/ldapmodrdn.c
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / clients / tools / ldapmodrdn.c
index 42c37aa31b0d9844726aec742f87bc9c878f172b..2575c47f93de715324a364084f9b03b19ab7f11a 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2011 The OpenLDAP Foundation.
+ * Copyright 1998-2012 The OpenLDAP Foundation.
  * Portions Copyright 1998-2003 Kurt D. Zeilenga.
  * Portions Copyright 1998-2001 Net Boolean Incorporated.
  * Portions Copyright 2001-2003 IBM Corporation.
@@ -156,7 +156,7 @@ main(int argc, char **argv)
 {
        char            *entrydn = NULL, *rdn = NULL, buf[ 4096 ];
        FILE            *fp = NULL;
-       LDAP            *ld;
+       LDAP            *ld = NULL;
        int             rc, retval, havedn;
 
        tool_init( TOOL_MODRDN );
@@ -227,13 +227,11 @@ main(int argc, char **argv)
                }
        }
 
-       tool_unbind( ld );
-       tool_destroy();
 fail:
        if ( fp && fp != stdin ) fclose( fp );
        if ( entrydn ) free( entrydn );
        if ( rdn ) free( rdn );
-       return( retval );
+       tool_exit( ld, retval );
 }
 
 static int domodrdn(