Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
openldap2-client.29147
0017-Plug-a-socket-leak-in-ldap_new_connection-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0017-Plug-a-socket-leak-in-ldap_new_connection-made-by-un.patch of Package openldap2-client.29147
From 70a603d5504b6a93d2d137fb56b13239a4d27df4 Mon Sep 17 00:00:00 2001 From: HouzuoGuo <guohouzuo@gmail.com> Date: Thu, 30 Nov 2017 14:54:45 +0100 Subject: [PATCH] Plug a socket leak in ldap_new_connection made by unsuccessful connection attempts diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index c2d6dd4..1935400 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -485,7 +485,18 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc **srvlist, int use_ldsb, int rc; rc = ldap_int_open_connection( ld, lc, *srvp, async ); - if ( rc != -1 ) { + if (rc == -1) { + ber_sockbuf_free( lc->lconn_sb ); + lc->lconn_sb = ber_sockbuf_alloc(); + if ( lc->lconn_sb == NULL ) { + LDAP_FREE( (char *)lc ); + ld->ld_errno = LDAP_NO_MEMORY; + return( NULL ); + } + if (use_ldsb) { + ld->ld_sb = lc->lconn_sb; + } + } else { srv = *srvp; /* If we fully connected, async is moot */ -- 2.15.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor