Open Bug 758576 Opened 8 years ago Updated 8 years ago

Do not use nsMemory::Free in nsHTMLDocument::QueryCommandState

Categories

(Core :: DOM: Editor, defect, minor)

defect
Not set
minor

Tracking

()

People

(Reporter: ayg, Unassigned)

References

Details

if (cmdToDispatch.Equals("cmd_align")) {
    char * actualAlignmentType = nsnull;
    rv = cmdParams->GetCStringValue("state_attribute", &actualAlignmentType);
    if (NS_SUCCEEDED(rv) && actualAlignmentType && actualAlignmentType[0]) {
      *_retval = paramToCheck.Equals(actualAlignmentType);
    }
    if (actualAlignmentType)
      nsMemory::Free(actualAlignmentType);
    return rv;
  }

This is C++, people.  We can use nsAutoString.
Flags: in-testsuite-
Well, nsXPIDLCString, more likely. Or changing nsICommandParams::getCStringValue to return ACString...
You need to log in before you can comment on or make changes to this bug.