Tag: cws_src680_macaddressbook01 User: fheckl Date: 2007-09-02 16:28:07+0000 Modified: dba/connectivity/source/drivers/macab/MacabAddressBook.cxx dba/connectivity/source/drivers/macab/MacabDriver.cxx dba/connectivity/source/drivers/macab/MacabRecord.cxx dba/connectivity/source/drivers/macab/MacabRecords.cxx
Log: Probable memory leaks fixed and issue 80756 File Changes: Directory: /dba/connectivity/source/drivers/macab/ ================================================== File [changed]: MacabAddressBook.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/macab/MacabAddressBook.cxx?r1=1.1.2.4&r2=1.1.2.5 Delta lines: +5 -2 ------------------- --- MacabAddressBook.cxx 2007-07-15 01:56:55+0000 1.1.2.4 +++ MacabAddressBook.cxx 2007-09-02 16:28:04+0000 1.1.2.5 @@ -4,9 +4,9 @@ * * $RCSfile: MacabAddressBook.cxx,v $ * - * $Revision: 1.1.2.4 $ + * $Revision: 1.1.2.5 $ * - * last change: $Author: cremlae $ $Date: 2007/07/15 01:56:55 $ + * last change: $Author: fheckl $ $Date: 2007/09/02 16:28:04 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -72,7 +72,10 @@ MacabAddressBook::~MacabAddressBook() { if(m_xMacabRecords != NULL) + { delete m_xMacabRecords; + m_xMacabRecords = NULL; + } if(!m_xMacabGroups.empty()) { File [changed]: MacabDriver.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/macab/MacabDriver.cxx?r1=1.1.2.2&r2=1.1.2.3 Delta lines: +3 -6 ------------------- --- MacabDriver.cxx 2007-07-29 18:15:59+0000 1.1.2.2 +++ MacabDriver.cxx 2007-09-02 16:28:04+0000 1.1.2.3 @@ -4,9 +4,9 @@ * * $RCSfile: MacabDriver.cxx,v $ * - * $Revision: 1.1.2.2 $ + * $Revision: 1.1.2.3 $ * - * last change: $Author: cremlae $ $Date: 2007/07/29 18:15:59 $ + * last change: $Author: fheckl $ $Date: 2007/09/02 16:28:04 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -86,10 +86,7 @@ // -------------------------------------------------------------------------------- bool MacabImplModule::isMacOSPresent() { - if ( !impl_loadModule() ) - return false; - - return true; + return impl_loadModule(); } // -------------------------------------------------------------------------------- File [changed]: MacabRecord.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/macab/MacabRecord.cxx?r1=1.1.2.3&r2=1.1.2.4 Delta lines: +15 -2 -------------------- --- MacabRecord.cxx 2007-07-15 01:56:55+0000 1.1.2.3 +++ MacabRecord.cxx 2007-09-02 16:28:04+0000 1.1.2.4 @@ -4,9 +4,9 @@ * * $RCSfile: MacabRecord.cxx,v $ * - * $Revision: 1.1.2.3 $ + * $Revision: 1.1.2.4 $ * - * last change: $Author: cremlae $ $Date: 2007/07/15 01:56:55 $ + * last change: $Author: fheckl $ $Date: 2007/09/02 16:28:04 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -62,6 +62,8 @@ // ------------------------------------------------------------------------- MacabRecord::MacabRecord() { + size = 0; + fields = NULL; } // ------------------------------------------------------------------------- @@ -77,6 +79,17 @@ // ------------------------------------------------------------------------- MacabRecord::~MacabRecord() { + if(size > 0) + { + int i; + for(i = 0; i < size; i++) + { + delete fields[i]; + fields[i] = NULL; + } + } + delete [] fields; + fields = NULL; } // ------------------------------------------------------------------------- File [changed]: MacabRecords.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/macab/MacabRecords.cxx?r1=1.1.2.5&r2=1.1.2.6 Delta lines: +4 -3 ------------------- --- MacabRecords.cxx 2007-07-15 22:22:02+0000 1.1.2.5 +++ MacabRecords.cxx 2007-09-02 16:28:04+0000 1.1.2.6 @@ -4,9 +4,9 @@ * * $RCSfile: MacabRecords.cxx,v $ * - * $Revision: 1.1.2.5 $ + * $Revision: 1.1.2.6 $ * - * last change: $Author: cremlae $ $Date: 2007/07/15 22:22:02 $ + * last change: $Author: fheckl $ $Date: 2007/09/02 16:28:04 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -213,6 +213,7 @@ { newRecordsArray[i] = records[i]; } + delete [] records; records = newRecordsArray; } @@ -251,7 +252,7 @@ MacabRecord *record = records[_recordNumber]; - if(_columnNumber >= record->getSize()) + if(_columnNumber < 0 || _columnNumber >= record->getSize()) return NULL; return record->get(_columnNumber); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
