diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index ca656b45a3..4390caaba2 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -415,7 +415,8 @@ main( int argc, char *argv[] ) done: /* disconnect from server */ - tool_unbind( ld ); + if ( ld ) + tool_unbind( ld ); tool_destroy(); return rc; }