Closed Bug 283238 Opened 19 years ago Closed 13 years ago

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

Categories

(MailNews Core :: Database, defect)

x86
Windows XP
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: timeless, Unassigned)

References

()

Details

(Keywords: crash, memory-leak)

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
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
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
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
(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
Closed: 13 years ago
Resolution: --- → WORKSFORME
Flags: wanted-thunderbird3?
You need to log in before you can comment on or make changes to this bug.