Commit 5779283a authored by Yang Tse's avatar Yang Tse
Browse files

attempt to fix or allow further detection of an elusive icc SIGSEGV

parent 80d0dcc9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -502,9 +502,12 @@ CURLcode curl_easy_perform(CURL *curl)
      /* global dns cache was requested but still isn't */
      struct curl_hash *ptr;

      if(data->dns.hostcachetype == HCACHE_PRIVATE)
      if(data->dns.hostcachetype == HCACHE_PRIVATE) {
        /* if the current cache is private, kill it first */
        Curl_hash_destroy(data->dns.hostcache);
        data->dns.hostcachetype = HCACHE_NONE;
        data->dns.hostcache = NULL;
      }

      ptr = Curl_global_host_cache_init();
      if(ptr) {
+4 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ hash_element_dtor(void *user, void *element)

  h->dtor(e->ptr);

  memset(e, 0, sizeof(struct curl_hash_element));
  free(e);
}

@@ -232,6 +233,7 @@ Curl_hash_clean(struct curl_hash *h)

  for (i = 0; i < h->slots; ++i) {
    Curl_llist_destroy(h->table[i], (void *) h);
    h->table[i] = NULL;
  }

  free(h->table);
@@ -269,6 +271,8 @@ Curl_hash_destroy(struct curl_hash *h)
    return;

  Curl_hash_clean(h);

  memset(h, 0, sizeof(struct struct curl_hash));
  free(h);
}

+1 −0
Original line number Diff line number Diff line
@@ -695,6 +695,7 @@ static void freednsentry(void *freethis)

  Curl_freeaddrinfo(p->addr);

  memset(p, 0, sizeof(struct Curl_dns_entry));
  free(p);
}

+3 −0
Original line number Diff line number Diff line
@@ -113,6 +113,8 @@ Curl_llist_remove(struct curl_llist *list, struct curl_llist_element *e,
  }

  list->dtor(user, e->ptr);

  memset(e, 0, sizeof(struct curl_llist_element));
  free(e);
  --list->size;

@@ -126,6 +128,7 @@ Curl_llist_destroy(struct curl_llist *list, void *user)
    while(list->size > 0)
      Curl_llist_remove(list, list->tail, user);

    memset(list, 0, sizeof(struct curl_llist));
    free(list);
  }
}
+2 −0
Original line number Diff line number Diff line
@@ -1551,6 +1551,8 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle)
    multi->type = 0; /* not good anymore */
    Curl_hash_destroy(multi->hostcache);
    Curl_hash_destroy(multi->sockhash);
    multi->hostcache = NULL;
    multi->sockhash = NULL;

    /* go over all connections that have close actions */
    for(i=0; i< multi->connc->num; i++) {
Loading