]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sock/opensock.c
Merge branch 'mdb.master'
[openldap] / servers / slapd / back-sock / opensock.c
index e2d4e80e920ca86c4b13236b5cde547ffd403b9e..b8d57ac617d09f8d7e5fa86aa40465c9aae34823 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2007-2008 The OpenLDAP Foundation.
+ * Copyright 2007-2011 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -57,6 +57,7 @@ opensock(
        if ( connect( fd, (struct sockaddr *)&sockun, sizeof(sockun) ) < 0 ) {
                Debug( LDAP_DEBUG_ANY, "socket connect(%s) failed\n",
                        sockpath ? sockpath : "<null>", 0, 0 );
+               close( fd );
                return( NULL );
        }