      return NS_OK;
  }
  
-+static int
-+advertInName(nsACString &result, const char *name) {
-+    // A hostname can only be 256 bytes long, so this buffer is long enough to
-+    // hold and any valid advert encoded in a name.
-+    unsigned char t[256];
-+    unsigned j = 0;  // current offset into t
-+
-+    for (;;) {
-+        if (strncmp(name, "opa", 3) == 0) {
-+            bool good = true;
-+            unsigned count = 0;
-+
-+            for (const char *i = name + 3; *i; ++i, count++) {
-+                const char c = *i;
-+                if ((c >= '0' && c <= '9') ||
-+                    (c > 'a' && c <= 'z' && c != 'e' && c != 'i' && c != 'o') ||
-+                    (c > 'A' && c <= 'Z' && c != 'E' && c != 'I' && c != 'O'))
-+                    continue;
-+                good = false;
-+                break;
-+            }
-+
-+            if (count == 0 || (count * 5) & 7)
-+                good = false;
-+
-+            unsigned space = sizeof(t) - j;
-+            if (!base32_decode(t + j, &space, (const uint8_t *) name + 3, count, 1))
-+                return 0;
-+            j += space;
-+        }
-+    }
-+
-+    if (!j)
-+        return 0;
-+
-+    result.Assign((const char *) t, j);
-+    return 1;
-+}
-+
-+NS_IMETHODIMP
+ NS_IMETHODIMP
 +nsDNSRecord::GetAdvert(nsACString &result)
 +{
++    char advert[256];
++    unsigned advertlen = sizeof(advert);
++
 +    PR_Lock(mHostRecord->hostent_lock);
 +    if (!mHostRecord->hostent_buf) {
 +        PR_Unlock(mHostRecord->hostent_lock);

     return NS_OK;
 }
diff --git a/netwerk/dns/src/nsHostResolver.cpp b/netwerk/dns/src/nsHostResolver.cpp
index 924159e..8dd5083 100644
--- a/netwerk/dns/src/nsHostResolver.cpp
+++ b/netwerk/dns/src/nsHostResolver.cpp
@@ -178,9 +178,9 @@ nsHostRecord::Create(const nsHostKey *key, nsHostRecord **result)

             OnSocketConnected();
 
             if (mSecInfo && !mProxyHost.IsEmpty() && proxyTransparent && usingSSL) {
@@ -1408,6 +1595,9 @@ nsSocketTransport::OnSocketEvent(PRUint32 type, nsresult status, nsISupports *pa
         if (param) {
             mDNSRecord = static_cast<nsIDNSRecord *>(param);
             mDNSRecord->GetNextAddr(SocketPort(), &mNetAddr);
+
+            nsCString *result = new nsCString();
+            delete result;
         }
         // status contains DNS lookup status
         if (NS_FAILED(status)) {
@@ -1506,6 +1696,11 @@ nsSocketTransport::OnSocketReady(PRFileDesc *fd, PRInt16 outFlags)
             //
             // we are connected!
             //
