]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPModList.cpp
Entry rwlock is no longer needed as concurrency is managed
[openldap] / contrib / ldapc++ / src / LDAPModList.cpp
index 876b6ddb88ce53c2e6d5cb7386d6bb105afc48ef..d8bed4f6851d6b778f66aa25ade9513a923d9cac 100644 (file)
@@ -7,6 +7,8 @@
 #include "LDAPModList.h"
 #include "debug.h"
 
+using namespace std;
+
 LDAPModList::LDAPModList(){
     DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPModList::LDAPModList()" << endl);
 }
@@ -23,12 +25,13 @@ void LDAPModList::addModification(const LDAPModification &mod){
 
 LDAPMod** LDAPModList::toLDAPModArray(){
     DEBUG(LDAP_DEBUG_TRACE,"LDAPModList::toLDAPModArray()" << endl);
-       LDAPMod **ret = new LDAPMod*[m_modList.size()+1];
-       ret[m_modList.size()]=0;
-       ModList::const_iterator i;
-       int j=0;
-       for (i=m_modList.begin(); i != m_modList.end(); i++ , j++){
-               ret[j]=i->toLDAPMod();
-       }
-       return ret;
+    LDAPMod **ret = (LDAPMod**) malloc(
+                   (m_modList.size()+1) * sizeof(LDAPMod*));
+    ret[m_modList.size()]=0;
+    ModList::const_iterator i;
+    int j=0;
+    for (i=m_modList.begin(); i != m_modList.end(); i++ , j++){
+           ret[j]=i->toLDAPMod();
+    }
+    return ret;
 }