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

- Fixed some trouble time.h / sys/time.h
- modified include statements
This commit is contained in:
Ralf Haferkamp 2001-03-15 11:07:58 +00:00
parent a5ea7aefd6
commit b1957678d4
38 changed files with 97 additions and 87 deletions

View file

@ -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)

View file

@ -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"

View file

@ -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;

View file

@ -36,6 +36,7 @@ LDAPAsynConnection::LDAPAsynConnection(const string& hostname, int port,
LDAPAsynConnection::~LDAPAsynConnection(){
DEBUG(LDAP_DEBUG_DESTROY,
"LDAPAsynConnection::~LDAPAsynConnection()" << endl);
delete m_constr;
unbind();
}

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -6,7 +6,7 @@
#ifndef LDAP_BIND_REQUEST_H
#define LDAP_BIND_REQUEST_H
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPBindRequest : LDAPRequest {
private:

View file

@ -6,7 +6,7 @@
#ifndef LDAP_COMPARE_REQUEST_H
#define LDAP_COMPARE_REQUEST_H
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPMessageQueue;

View file

@ -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);

View file

@ -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

View file

@ -5,6 +5,8 @@
#include "debug.h"
#include "config.h"
#include "ac/time.h"
#include "LDAPConstraints.h"
#include "LDAPControlSet.h"

View file

@ -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)

View file

@ -8,7 +8,7 @@
#include <list>
#include <ldap.h>
#include "LDAPControl.h"
#include <LDAPControl.h>
typedef list<LDAPCtrl> CtrlList;

View file

@ -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{

View file

@ -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.

View file

@ -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
*/

View file

@ -6,7 +6,7 @@
#ifndef LDAP_EXT_REQUEST_H
#define LDAP_EXT_REQUEST_H
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPExtRequest : LDAPRequest {

View file

@ -8,7 +8,7 @@
#include <ldap.h>
#include "LDAPResult.h"
#include <LDAPResult.h>
class LDAPRequest;

View file

@ -8,7 +8,7 @@
#define LDAP_MSG_H
#include <ldap.h>
#include "LDAPControlSet.h"
#include <LDAPControlSet.h>
class LDAPRequest;
/**

View file

@ -9,7 +9,7 @@
#include <stack>
#include "LDAPUrlList.h"
#include <LDAPUrlList.h>
class LDAPAsynConnection;
class LDAPMsg;

View file

@ -6,7 +6,7 @@
#ifndef LDAP_MOD_DN_REQUEST_H
#define LDAP_MOD_DN_REQUEST_H
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPModDNRequest : LDAPRequest {

View file

@ -9,7 +9,7 @@
#include <ldap.h>
#include <list>
#include "LDAPModification.h"
#include <LDAPModification.h>
typedef list<LDAPModification> ModList;

View file

@ -8,7 +8,7 @@
#define LDAP_MODIFICATION_H
#include <ldap.h>
#include "LDAPAttribute.h"
#include <LDAPAttribute.h>
class LDAPModification{
public:

View file

@ -6,7 +6,7 @@
#ifndef LDAP_MODIFY_REQUEST_H
#define LDAP_MODIFY_REQUEST_H
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPMessageQueue;

View file

@ -7,7 +7,7 @@
#define LDAP_REBIND_H
#include <string>
#include "LDAPRebindAuth.h"
#include <LDAPRebindAuth.h>
/**
* Just an abstract class to provide a mechnism for rebind to another

View file

@ -18,9 +18,9 @@ typedef list<LDAPSearchReference> RefList;
* Used internally only by LDAPSearchResults
*/
class LDAPReferenceList{
typedef RefList::const_iterator const_iterator;
public:
typedef RefList::const_iterator const_iterator;
/**
* Constructs an empty list.
*/

View file

@ -8,8 +8,8 @@
#define LDAP_REFERRAL_EXCEPTION_H
#include <list>
#include "LDAPMessage.h"
#include "LDAPUrlList.h"
#include <LDAPMessage.h>
#include <LDAPUrlList.h>
class LDAPUrlList;

View file

@ -7,9 +7,9 @@
#ifndef LDAP_REQUEST_H
#define LDAP_REQUEST_H
#include "LDAPConstraints.h"
#include "LDAPAsynConnection.h"
#include "LDAPMessageQueue.h"
#include <LDAPConstraints.h>
#include <LDAPAsynConnection.h>
#include <LDAPMessageQueue.h>
class LDAPUrl;

View file

@ -9,9 +9,9 @@
#include<iostream>
#include<ldap.h>
#include "LDAPMessage.h"
#include "LDAPControlSet.h"
#include "LDAPUrlList.h"
#include <LDAPMessage.h>
#include <LDAPControlSet.h>
#include <LDAPUrlList.h>
class LDAPRequest;
class LDAPAsynConnection;

View file

@ -7,8 +7,8 @@
#ifndef LDAP_SEARCH_REFERENCE_H
#define LDAP_SEARCH_REFERENCE_H
#include "LDAPMessage.h"
#include "LDAPUrlList.h"
#include <LDAPMessage.h>
#include <LDAPUrlList.h>
class LDAPRequest;
class LDAPUrl;

View file

@ -3,6 +3,8 @@
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include "config.h"
#include "ac/time.h"
#include "debug.h"
#include "LDAPSearchRequest.h"
#include "LDAPException.h"

View file

@ -7,7 +7,7 @@
#define LDAP_SEARCH_REQUEST_H
#include <queue>
#include "LDAPRequest.h"
#include <LDAPRequest.h>
class LDAPSearchReference;
class LDAPReferral;

View file

@ -7,8 +7,8 @@
#ifndef LDAP_SEARCH_RESULT_H
#define LDAP_SEARCH_RESULT_H
#include "LDAPMessage.h"
#include "LDAPEntry.h"
#include <LDAPMessage.h>
#include <LDAPEntry.h>
class LDAPRequest;

View file

@ -6,12 +6,12 @@
#ifndef LDAP_SEARCH_RESULTS_H
#define LDAP_SEARCH_RESULTS_H
#include "LDAPEntry.h"
#include "LDAPEntryList.h"
#include "LDAPMessage.h"
#include "LDAPMessageQueue.h"
#include "LDAPReferenceList.h"
#include "LDAPSearchReference.h"
#include <LDAPEntry.h>
#include <LDAPEntryList.h>
#include <LDAPMessage.h>
#include <LDAPMessageQueue.h>
#include <LDAPReferenceList.h>
#include <LDAPSearchReference.h>
class LDAPResult;

View file

@ -8,7 +8,7 @@
#define LDAP_URL_H
#include <ldap.h>
#include "StringList.h"
#include <StringList.h>
/**
* This class is used to analyze and store LDAP-Urls as returned by a

View file

@ -7,7 +7,7 @@
#define LDAP_URL_LIST_H
#include <list>
#include "LDAPUrl.h"
#include <LDAPUrl.h>
typedef list<LDAPUrl> UrlList;
@ -15,9 +15,9 @@ typedef list<LDAPUrl> UrlList;
* This container class is used to store multiple LDAPUrl-objects.
*/
class LDAPUrlList{
typedef UrlList::const_iterator const_iterator;
public:
typedef UrlList::const_iterator const_iterator;
/**
* Constructs an empty list.
*/

View file

@ -14,12 +14,12 @@ typedef list<string> ListType;
* Container class to store multiple string-objects
*/
class StringList{
typedef ListType::const_iterator const_iterator;
private:
ListType m_data;
public:
typedef ListType::const_iterator const_iterator;
/**
* Constructs an empty list.
*/