From 4ca45e5081ba1fbffcb154589f253c0844e7fd58 Mon Sep 17 00:00:00 2001 From: Andreas Bille Date: Thu, 5 Jul 2001 17:50:40 +0000 Subject: #89246# Refcounting ConceptData, so not freeing it twice, which causes the GPF. Fixed some memory leaks. Fixing a memory overwrite in BreeDict.cxx --- xmlhelp/source/cxxhelp/db/Block.cxx | 8 ++++++-- xmlhelp/source/cxxhelp/db/BtreeDict.cxx | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'xmlhelp/source/cxxhelp/db') diff --git a/xmlhelp/source/cxxhelp/db/Block.cxx b/xmlhelp/source/cxxhelp/db/Block.cxx index a9282a3edc44..c9bb5368241c 100644 --- a/xmlhelp/source/cxxhelp/db/Block.cxx +++ b/xmlhelp/source/cxxhelp/db/Block.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Block.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: abi $ $Date: 2001-05-10 15:25:10 $ + * last change: $Author: abi $ $Date: 2001-07-05 18:50:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -58,6 +58,9 @@ * * ************************************************************************/ +#ifndef _RTL_MEMORY_H_ +#include +#endif #ifndef _XMLSEARCH_DB_BLOCK_HXX_ #include #endif @@ -88,6 +91,7 @@ Block::Block( const DBEnv* dbenv ) dataL_( dbenv->getDataLen() ), data_( new sal_Int8[ dbenv->getDataLen() ] ) { + rtl_zeroMemory( data_,dataL_ ); } diff --git a/xmlhelp/source/cxxhelp/db/BtreeDict.cxx b/xmlhelp/source/cxxhelp/db/BtreeDict.cxx index 9c3cf80bd6da..06a970f77f18 100644 --- a/xmlhelp/source/cxxhelp/db/BtreeDict.cxx +++ b/xmlhelp/source/cxxhelp/db/BtreeDict.cxx @@ -2,9 +2,9 @@ * * $RCSfile: BtreeDict.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: abi $ $Date: 2001-06-22 14:13:18 $ + * last change: $Author: abi $ $Date: 2001-07-05 18:50:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -368,7 +368,7 @@ BtreeDict::BtreeDict( const util::IndexAccessor& indexAccessor ) throw( IOExcept { sal_Int32 len = SCHEMA->length(); char* bff = new char[ 1 + len ]; - bff[ 1 + len ] = 0; + bff[ len ] = 0; SCHEMA->readBytes( reinterpret_cast( bff ),len ); delete SCHEMA; -- cgit