static CURLcode hsts_create(struct hsts *h,
                            const char *hostname,
                            bool subdomains,
                            curl_off_t expires)
{
  struct stsentry *sts = hsts_entry();
  char *duphost;
  size_t hlen;
  if(!sts)
    return CURLE_OUT_OF_MEMORY;

  duphost = strdup(hostname);
  if(!duphost) {
    free(sts);
    return CURLE_OUT_OF_MEMORY;
  }

  hlen = strlen(duphost);
  if(duphost[hlen - 1] == '.')
    /* strip off trailing any dot */
    duphost[--hlen] = 0;

  sts->host = duphost;
  sts->expires = expires;
  sts->includeSubDomains = subdomains;
  Curl_llist_insert_next(&h->list, h->list.tail, sts, &sts->node);
  return CURLE_OK;
}
static CURLcode hsts_create(struct hsts *h,
                            const char *hostname,
                            bool subdomains,
                            curl_off_t expires)
{
  struct stsentry *sts = hsts_entry();
  char *duphost;
  size_t hlen;
  if(!sts)
    return CURLE_OUT_OF_MEMORY;

  duphost = strdup(hostname);
  if(!duphost) {
    free(sts);
    return CURLE_OUT_OF_MEMORY;
  }

  hlen = strlen(duphost);
  if(duphost[hlen - 1] == '.')
     
    duphost[--hlen] = 0;

  sts->host = duphost;
  sts->expires = expires;
  sts->includeSubDomains = subdomains;
  Curl_llist_insert_next(&h->list, h->list.tail, sts, &sts->node);
  return CURLE_OK;
}