delete value;
delete[] value;
HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode){  nsresult rv = NS_OK;  if (nsnull != mHead) {    // Create content object    nsAutoString tmp("meta");    nsIAtom* atom = NS_NewAtom(tmp);    if (nsnull == atom) {      return NS_ERROR_OUT_OF_MEMORY;    }    nsIHTMLContent* it;    rv = NS_NewHTMLMetaElement(&it, atom);    NS_RELEASE(atom);    if (NS_OK == rv) {      // Add in the attributes and add the meta content object to the      // head container.      nsIScriptContextOwner* sco = mDocument->GetScriptContextOwner();      it->SetDocument(mDocument, PR_FALSE);      rv = AddAttributes(aNode, it, sco);      NS_IF_RELEASE(sco);      if (NS_OK != rv) {        NS_RELEASE(it);        return rv;      }      mHead->AppendChildTo(it, PR_FALSE);      // If we are processing an HTTP url, handle meta http-equiv cases      nsIHttpURL* httpUrl = nsnull;      rv = mDocumentURL->QueryInterface(kIHTTPURLIID, (void **)&httpUrl);       // set any HTTP-EQUIV data into document's header data as well as url      nsAutoString header;      it->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::httpEquiv, header);      if (header.Length() > 0) {        nsAutoString result;        it->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::content, result);        if (result.Length() > 0) {          if (nsnull != httpUrl) {            char* value = result.ToNewCString(), *csHeader;            if (!value) {              NS_RELEASE(it);              return NS_ERROR_OUT_OF_MEMORY;            }            csHeader = header.ToNewCString();            if (!csHeader) {                delete value;                NS_RELEASE(it);                return NS_ERROR_OUT_OF_MEMORY;            }            httpUrl->AddMimeHeader(csHeader, value);            delete csHeader;            delete value;          }          header.ToLowerCase();          nsIAtom* fieldAtom = NS_NewAtom(header);          mDocument->SetHeaderData(fieldAtom, result);          if (fieldAtom == nsHTMLAtoms::headerDefaultStyle) {            mPreferredStyle = result;          }          else if (fieldAtom == nsHTMLAtoms::link) {            rv = ProcessLink(it, result);          }          else if (fieldAtom == nsHTMLAtoms::headerContentBase) {            ProcessBaseHref(result);          }          else if (fieldAtom == nsHTMLAtoms::headerWindowTarget) {            ProcessBaseTarget(result);          }          NS_IF_RELEASE(fieldAtom);        }      }      NS_IF_RELEASE(httpUrl);      NS_RELEASE(it);    }  }  return rv;}