char* aContentType = nsnull; rv = channel->GetContentType(&aContentType); if (NS_FAILED(rv)) return rv; nsCOMPtr<nsIURI> aURL; rv = channel->GetURI(getter_AddRefs(aURL)); if (NS_FAILED(rv)) return rv;
if (aContentType) nsCRT::free(aContentType);
nsPluginStreamListenerPeer::OnStartRequest(nsIChannel* channel, nsISupports* aContext){  nsresult  rv = NS_OK;  char* aContentType = nsnull;  rv = channel->GetContentType(&aContentType);  if (NS_FAILED(rv)) return rv;  nsCOMPtr<nsIURI> aURL;  rv = channel->GetURI(getter_AddRefs(aURL));  if (NS_FAILED(rv)) return rv;  if (nsnull != aContentType)	  mPluginStreamInfo->SetContentType(aContentType);  nsPluginWindow    *window = nsnull;  // if we don't have an nsIPluginInstance (mInstance), it means  // we weren't able to load a plugin previously because we  // didn't have the mimetype.  Now that we do (aContentType),  // we'll try again with SetUpPluginInstance()  if ((nsnull == mInstance) && (nsnull != mOwner))  {    mOwner->GetInstance(mInstance);    mOwner->GetWindow(window);    if ((nsnull == mInstance) && (nsnull != mHost) && (nsnull != window))    {      rv = mHost->SetUpPluginInstance(aContentType, aURL, mOwner);      if (NS_OK == rv)      {		// GetInstance() adds a ref        mOwner->GetInstance(mInstance);        if (nsnull != mInstance)        {          mInstance->Start();          mOwner->CreateWidget();          mInstance->SetWindow(window);        }      }    }  }  nsCRT::free(aContentType);  //  // Set up the stream listener...  //  PRInt32 length;  rv = channel->GetContentLength(&length);  if (NS_FAILED(rv)) return rv;  mPluginStreamInfo->SetLength(length);  rv = SetUpStreamListener(aURL);  if (NS_FAILED(rv)) return rv;  mOnStartRequest = PR_TRUE;  return rv;}