Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
23802465
Commit
23802465
authored
Feb 26, 2014
by
Kevin H. Patterson
Committed by
Quanah Gibson-Mount
Apr 01, 2014
Browse files
ITS#7806 fixed memory leak in LDAPAsynConnection.cpp
parent
464e84c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
contrib/ldapc++/src/LDAPAsynConnection.cpp
View file @
23802465
...
@@ -43,7 +43,10 @@ LDAPAsynConnection::LDAPAsynConnection(const string& url, int port,
...
@@ -43,7 +43,10 @@ LDAPAsynConnection::LDAPAsynConnection(const string& url, int port,
this
->
setConstraints
(
cons
);
this
->
setConstraints
(
cons
);
}
}
LDAPAsynConnection
::~
LDAPAsynConnection
(){}
LDAPAsynConnection
::~
LDAPAsynConnection
(){
unbind
();
delete
m_constr
;
}
void
LDAPAsynConnection
::
init
(
const
string
&
hostname
,
int
port
){
void
LDAPAsynConnection
::
init
(
const
string
&
hostname
,
int
port
){
DEBUG
(
LDAP_DEBUG_TRACE
,
"LDAPAsynConnection::init"
<<
endl
);
DEBUG
(
LDAP_DEBUG_TRACE
,
"LDAPAsynConnection::init"
<<
endl
);
...
@@ -51,6 +54,8 @@ void LDAPAsynConnection::init(const string& hostname, int port){
...
@@ -51,6 +54,8 @@ void LDAPAsynConnection::init(const string& hostname, int port){
" hostname:"
<<
hostname
<<
endl
" hostname:"
<<
hostname
<<
endl
<<
" port:"
<<
port
<<
endl
);
<<
" port:"
<<
port
<<
endl
);
unbind
();
m_uri
.
setScheme
(
"ldap"
);
m_uri
.
setScheme
(
"ldap"
);
m_uri
.
setHost
(
hostname
);
m_uri
.
setHost
(
hostname
);
m_uri
.
setPort
(
port
);
m_uri
.
setPort
(
port
);
...
@@ -66,6 +71,8 @@ void LDAPAsynConnection::init(const string& hostname, int port){
...
@@ -66,6 +71,8 @@ void LDAPAsynConnection::init(const string& hostname, int port){
}
}
void
LDAPAsynConnection
::
initialize
(
const
std
::
string
&
uri
){
void
LDAPAsynConnection
::
initialize
(
const
std
::
string
&
uri
){
unbind
();
m_uri
.
setURLString
(
uri
);
m_uri
.
setURLString
(
uri
);
int
ret
=
ldap_initialize
(
&
cur_session
,
m_uri
.
getURLString
().
c_str
());
int
ret
=
ldap_initialize
(
&
cur_session
,
m_uri
.
getURLString
().
c_str
());
if
(
ret
!=
LDAP_SUCCESS
)
{
if
(
ret
!=
LDAP_SUCCESS
)
{
...
@@ -277,6 +284,7 @@ void LDAPAsynConnection::unbind(){
...
@@ -277,6 +284,7 @@ void LDAPAsynConnection::unbind(){
void
LDAPAsynConnection
::
setConstraints
(
LDAPConstraints
*
cons
){
void
LDAPAsynConnection
::
setConstraints
(
LDAPConstraints
*
cons
){
DEBUG
(
LDAP_DEBUG_TRACE
,
"LDAPAsynConnection::setConstraints()"
<<
endl
);
DEBUG
(
LDAP_DEBUG_TRACE
,
"LDAPAsynConnection::setConstraints()"
<<
endl
);
delete
m_constr
;
m_constr
=
cons
;
m_constr
=
cons
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment