Commit b1957678 authored by Ralf Haferkamp's avatar Ralf Haferkamp
Browse files

- Fixed some memory leak detected by Jeff Costlow <j.costlow@f5.com>

- Fixed some trouble time.h / sys/time.h
- modified include statements
parent a5ea7aef
......@@ -80,10 +80,9 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ./src/config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = README AUTHORS INSTALL Makefile.am Makefile.in TODO \
acconfig.h aclocal.m4 config.guess config.sub configure configure.in \
install-sh ltconfig ltmain.sh missing mkinstalldirs src/config.h.in \
src/stamp-h.in
DIST_COMMON = README AUTHORS Makefile.am Makefile.in TODO acconfig.h \
aclocal.m4 config.guess config.sub configure configure.in install-sh \
ltconfig ltmain.sh missing mkinstalldirs src/config.h.in src/stamp-h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
......
......@@ -476,31 +476,35 @@ esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library, adds --enable-ltdl-convenience to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
# the libltdl convenience library and INCLTDL to the include flags for
# the libltdl header and adds --enable-ltdl-convenience to the
# configure arguments. Note that LIBLTDL and INCLTDL are not
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
# with '${top_builddir}/' and INCLTDL will be prefixed with
# '${top_srcdir}/' (note the single quotes!). If your package is not
# flat and you're not using automake, define top_builddir and
# top_srcdir appropriately in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library, and adds --enable-ltdl-install to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
# the libltdl installable library and INCLTDL to the include flags for
# the libltdl header and adds --enable-ltdl-install to the configure
# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
# with '${top_srcdir}/' (note the single quotes!). If your package is
# not flat and you're not using automake, define top_builddir and
# top_srcdir appropriately in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
......@@ -513,8 +517,8 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
......
......@@ -6,8 +6,8 @@
#ifndef LDAP_ADD_REQUEST_H
#define LDAP_ADD_REQUEST_H
#include "LDAPRequest.h"
#include "LDAPEntry.h"
#include <LDAPRequest.h>
#include <LDAPEntry.h>
class LDAPMessageQueue;
......
......@@ -36,6 +36,7 @@ LDAPAsynConnection::LDAPAsynConnection(const string& hostname, int port,
LDAPAsynConnection::~LDAPAsynConnection(){
DEBUG(LDAP_DEBUG_DESTROY,
"LDAPAsynConnection::~LDAPAsynConnection()" << endl);
delete m_constr;
unbind();
}
......
......@@ -13,12 +13,12 @@
#include<ldap.h>
#include<lber.h>
#include "LDAPMessageQueue.h"
#include "LDAPConstraints.h"
#include "LDAPModification.h"
#include "LDAPModList.h"
#include "LDAPUrl.h"
#include "LDAPUrlList.h"
#include <LDAPMessageQueue.h>
#include <LDAPConstraints.h>
#include <LDAPModification.h>
#include <LDAPModList.h>
#include <LDAPUrl.h>
#include <LDAPUrlList.h>
class LDAPEntry;
class LDAPAttribute;
......
......@@ -12,7 +12,7 @@
#include<ldap.h>
#include<lber.h>
#include "StringList.h"
#include <StringList.h>
/**
* Represents the name an value(s) of an Attribute
......
......@@ -18,12 +18,12 @@ typedef list<LDAPAttribute> AttrList;
* This container class is used to store multiple LDAPAttribute-objects.
*/
class LDAPAttributeList{
typedef AttrList::const_iterator const_iterator;
private :
AttrList m_attrs;
public :
typedef AttrList::const_iterator const_iterator;
/**
* Copy-constructor
......
......@@ -6,7 +6,7 @@
#ifndef LDAP_BIND_REQUEST_H
#define LDAP_BIND_REQUEST_H
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPBindRequest : LDAPRequest {
private:
......
......@@ -6,7 +6,7 @@
#ifndef LDAP_COMPARE_REQUEST_H
#define LDAP_COMPARE_REQUEST_H
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPMessageQueue;
......
......@@ -50,6 +50,7 @@ void LDAPConnection::bind(const string& dn, const string& passwd,
}
}
delete res;
delete msg; // memcheck
}
void LDAPConnection::unbind(){
......@@ -243,11 +244,12 @@ LDAPSearchResults* LDAPConnection::search(const string& base, int scope,
LDAPSearchResults* results= 0;
try{
results = new LDAPSearchResults();
msgq = LDAPAsynConnection::search(base,scope, filter, attrs, attrsOnly,
cons);
results = new LDAPSearchResults();
res = results->readMessageQueue(msgq);
}catch(LDAPException e){
delete results; // memcheck
delete msgq;
throw;
}
......@@ -262,12 +264,14 @@ LDAPSearchResults* LDAPConnection::search(const string& base, int scope,
case LDAPResult::REFERRAL :
{
LDAPUrlList urls = res->getReferralUrls();
delete results; // memcheck
delete res;
delete msgq;
throw LDAPReferralException(urls);
}
break;
default :
delete results; // memcheck
delete res;
delete msgq;
throw LDAPException(resCode);
......
......@@ -6,9 +6,9 @@
#ifndef LDAP_CONNECTION_H
#define LDAP_CONNECTION_H
#include "LDAPSearchResults.h"
#include "LDAPExtResult.h"
#include "LDAPAsynConnection.h"
#include <LDAPSearchResults.h>
#include <LDAPExtResult.h>
#include <LDAPAsynConnection.h>
/** Main class for synchronous LDAP-Communication
*
......@@ -48,7 +48,7 @@ class LDAPConnection : private LDAPAsynConnection {
* this connection
*/
LDAPConnection(const string& hostname="localhost", int port=389,
LDAPConstraints* cons=0);
LDAPConstraints* cons=new LDAPConstraints());
/**
* Destructor
......
......@@ -5,6 +5,8 @@
#include "debug.h"
#include "config.h"
#include "ac/time.h"
#include "LDAPConstraints.h"
#include "LDAPControlSet.h"
......
......@@ -7,12 +7,10 @@
#ifndef LDAP_CONSTRAINTS_H
#define LDAP_CONSTRAINTS_H
#include <list>
#include "config.h"
#include "ac/time.h"
#include "LDAPControl.h"
#include "LDAPControlSet.h"
#include "LDAPRebind.h"
#include <LDAPControl.h>
#include <LDAPControlSet.h>
#include <LDAPRebind.h>
//TODO!!
// * implement the Alias-Handling Option (OPT_DEREF)
......
......@@ -8,7 +8,7 @@
#include <list>
#include <ldap.h>
#include "LDAPControl.h"
#include <LDAPControl.h>
typedef list<LDAPCtrl> CtrlList;
......
......@@ -6,7 +6,7 @@
#ifndef LDAP_DELETE_REQUEST_H
#define LDAP_DELETE_REQUEST_H
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPMessageQueue;
class LDAPDeleteRequest : public LDAPRequest{
......
......@@ -8,8 +8,8 @@
#define LDAP_ENTRY_H
#include <ldap.h>
#include "LDAPAsynConnection.h"
#include "LDAPAttributeList.h"
#include <LDAPAsynConnection.h>
#include <LDAPAttributeList.h>
/**
* This class is used to store every kind of LDAP Entry.
......
......@@ -19,9 +19,9 @@ typedef list<LDAPEntry> EntryList;
* LDAPEntry-Objects
*/
class LDAPEntryList{
typedef EntryList::const_iterator const_iterator;
public:
typedef EntryList::const_iterator const_iterator;
/**
* Copy-Constructor
*/
......
......@@ -6,7 +6,7 @@
#ifndef LDAP_EXT_REQUEST_H
#define LDAP_EXT_REQUEST_H
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPExtRequest : LDAPRequest {
......
......@@ -8,7 +8,7 @@
#include <ldap.h>
#include "LDAPResult.h"
#include <LDAPResult.h>
class LDAPRequest;
......
......@@ -8,7 +8,7 @@
#define LDAP_MSG_H
#include <ldap.h>
#include "LDAPControlSet.h"
#include <LDAPControlSet.h>
class LDAPRequest;
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment