various mork functions silently leak in error case

NEW
Unassigned

Status

MailNews Core
Database
--
minor
14 years ago
6 years ago

People

(Reporter: dbaron, Unassigned)

Tracking

({memory-leak})

Trunk
memory-leak

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
Filing in MailNews: Mail Database for lack of a better component for mork bugs.

Various mork functions, such as:
  morkTableRowCursor::NextRow
  morkTableRowCursor::PrevRow
  morkTableRowCursor::MakeUniqueCursor
  morkTable::GetMetaRow
  morkTable::GetTableRowCursor
  morkTable::PosToRow
  morkTable::NewRow
  morkFactory::CreateNewFile
  morkFactory::MakeHeap
  morkFactory::OpenFilePort
  morkFactory::ThumbToOpenPort
  morkFactory::OpenFileStore
  morkFactory::ThumbToOpenStore
  morkFactory::CreateNewFileStore
and probably others end with code like:

  if ( acqStore )
    *acqStore = outStore;

All of these functions will silently leak if the out parameter is null.

I think these functions should definitely assert if the out parameter is null so
they can't lead to silent leaks.  However, I also don't see any reason to
null-check out parameters (other than for DEBUG-only assertions) when getting
the out parameter is the sole purpose of calling the function -- so I think the
better solution to this bug is to remove the null checks rather than adding
|else outStore->Release();| after each one.
Product: MailNews → Core
QA Contact: database
(Assignee)

Updated

10 years ago
Product: Core → MailNews Core

Updated

6 years ago
Assignee: dbienvenu → nobody
You need to log in before you can comment on or make changes to this bug.