Audit mozilla/mailnews/base/src/nsMsgDBView.cpp

RESOLVED WORKSFORME

Status

MailNews Core
Database
--
critical
RESOLVED WORKSFORME
14 years ago
7 years ago

People

(Reporter: timeless, Unassigned)

Tracking

({crash, memory-leak})

Trunk
x86
Windows XP
crash, memory-leak
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
audit issues:
unchecked allocs => don't crash (or leak)
leaking on oom => don't leak :)
else after return/return after else => drop the else and fix the indentation
ns_assertion(0,...) => use ns_error
(Reporter)

Comment 1

14 years ago
hrm, to be clear, for return after else, you need to negate the if condition,
promote the return and then unindent the main block.

if (foo) {
  statement;
  statement;
} else
  return blah;

=>

if (!foo)
  return blah;
statement;
statement;
Status: NEW → ASSIGNED
QA Contact: database
(Assignee)

Updated

10 years ago
Product: Core → MailNews Core
Gandalf, still working on this?

(file in question is at: http://mxr.mozilla.org/comm-central/source/mailnews/base/src/nsMsgDBView.cpp )
Flags: wanted-thunderbird3?
didn't touch it in 4 years, so feel free to takeover. :)
Assignee: gandalf → nobody
Status: ASSIGNED → NEW
Flags: wanted-thunderbird3?
Severity: minor → major
Flags: wanted-thunderbird3?
Keywords: crash, mlk

Comment 4

9 years ago
perhaps also bug 456332 and bug 460036?  If so, this is likely also causing topcrashes
Severity: major → critical
(In reply to comment #0)
> ns_assertion(0,...) => use ns_error

More global issue, moved to bug 489505.
Depends on: 489505

Comment 6

7 years ago
(In reply to comment #0)
> audit issues:
> 1. unchecked allocs => don't crash (or leak)
> 2. leaking on oom => don't leak :)
> 3. else after return/return after else => drop the else and fix the indentation
> 4. ns_assertion(0,...) => use ns_error

Is there anything here left to do? 
I skimmed the source and it looks like 1,3,4 are done. 
I this also done? 
  > leaking on oom => don't leak :)
(In reply to comment #6)
> I this also done? 
>   > leaking on oom => don't leak :)

The mozilla codebase has been moving to an abort-on-oom for failure, so out-of-memory should just cause the program to crash instead of merely leaking...
Resolve WFM then. :)
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
Flags: wanted-thunderbird3?
You need to log in before you can comment on or make changes to this bug.