Curl_altsvc_cleanup:
  377|    813|{
  378|    813|  if(*asi) {
  ------------------
  |  Branch (378:6): [True: 0, False: 813]
  ------------------
  379|      0|    struct Curl_llist_node *e;
  380|      0|    struct Curl_llist_node *n;
  381|      0|    struct altsvcinfo *altsvc = *asi;
  382|      0|    for(e = Curl_llist_head(&altsvc->list); e; e = n) {
  ------------------
  |  Branch (382:45): [True: 0, False: 0]
  ------------------
  383|      0|      struct altsvc *as = Curl_node_elem(e);
  384|      0|      n = Curl_node_next(e);
  385|      0|      altsvc_free(as);
  ------------------
  |  |   87|      0|#define altsvc_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  386|      0|    }
  387|      0|    curlx_free(altsvc->filename);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  388|      0|    curlx_free(altsvc);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  389|       |    *asi = NULL; /* clear the pointer */
  390|      0|  }
  391|    813|}
Curl_altsvc_save:
  398|    813|{
  399|    813|  CURLcode result = CURLE_OK;
  400|    813|  FILE *out;
  401|    813|  char *tempstore = NULL;
  402|       |
  403|    813|  if(!asi)
  ------------------
  |  Branch (403:6): [True: 813, False: 0]
  ------------------
  404|       |    /* no cache activated */
  405|    813|    return CURLE_OK;
  406|       |
  407|       |  /* if not new name is given, use the one we stored from the load */
  408|      0|  if(!file && asi->filename)
  ------------------
  |  Branch (408:6): [True: 0, False: 0]
  |  Branch (408:15): [True: 0, False: 0]
  ------------------
  409|      0|    file = asi->filename;
  410|       |
  411|      0|  if((asi->flags & CURLALTSVC_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1044|      0|#define CURLALTSVC_READONLYFILE (1L << 2)
  ------------------
  |  Branch (411:6): [True: 0, False: 0]
  |  Branch (411:48): [True: 0, False: 0]
  |  Branch (411:57): [True: 0, False: 0]
  ------------------
  412|       |    /* marked as read-only, no file or zero length filename */
  413|      0|    return CURLE_OK;
  414|       |
  415|      0|  result = Curl_fopen(data, file, &out, &tempstore);
  416|      0|  if(!result) {
  ------------------
  |  Branch (416:6): [True: 0, False: 0]
  ------------------
  417|      0|    struct Curl_llist_node *e;
  418|      0|    struct Curl_llist_node *n;
  419|      0|    fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n"
  420|      0|          "# This file was generated by libcurl! Edit at your own risk.\n",
  421|      0|          out);
  422|      0|    for(e = Curl_llist_head(&asi->list); e; e = n) {
  ------------------
  |  Branch (422:42): [True: 0, False: 0]
  ------------------
  423|      0|      struct altsvc *as = Curl_node_elem(e);
  424|      0|      n = Curl_node_next(e);
  425|      0|      result = altsvc_out(as, out);
  426|      0|      if(result)
  ------------------
  |  Branch (426:10): [True: 0, False: 0]
  ------------------
  427|      0|        break;
  428|      0|    }
  429|      0|    curlx_fclose(out);
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  430|      0|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   74|      0|#define curlx_rename            rename
  ------------------
  |  Branch (430:8): [True: 0, False: 0]
  |  Branch (430:19): [True: 0, False: 0]
  |  Branch (430:32): [True: 0, False: 0]
  ------------------
  431|      0|      result = CURLE_WRITE_ERROR;
  432|       |
  433|      0|    if(result && tempstore)
  ------------------
  |  Branch (433:8): [True: 0, False: 0]
  |  Branch (433:18): [True: 0, False: 0]
  ------------------
  434|      0|      unlink(tempstore);
  435|      0|  }
  436|      0|  curlx_free(tempstore);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  437|      0|  return result;
  438|      0|}

Curl_eapi_enter:
  191|    813|{
  192|    813|  struct Curl_easy *data = curl;
  193|    813|  const struct Curl_eapi_fn_props *fn_props;
  194|    813|  CURLcode result = CURLE_OK;
  195|       |
  196|    813|  guard->depth = 0;
  197|       |
  198|       |  /* Verify that we got an easy handle we can work with. */
  199|    813|  if(!GOOD_EASY_HANDLE(data) || data->state.internal) {
  ------------------
  |  |   34|  1.62k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|    813|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1020|    813|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:5): [True: 813, False: 0]
  |  |  |  Branch (34:12): [True: 813, False: 0]
  |  |  ------------------
  |  |   35|  1.62k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1023|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (199:6): [True: 0, False: 813]
  |  Branch (199:7): [True: 0, False: 0]
  |  Branch (199:7): [True: 0, False: 0]
  |  Branch (199:33): [True: 0, False: 813]
  ------------------
  200|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  201|      0|    goto out;
  202|      0|  }
  203|       |  /* verify that is either not added to a multi handle OR has a
  204|       |   * GOOD multi handle that knows `data` for `data->mid`. */
  205|    813|  if(data->mid != UINT32_MAX) {
  ------------------
  |  Branch (205:6): [True: 0, False: 813]
  ------------------
  206|      0|    if(GOOD_MULTI_HANDLE(data->multi)) {
  ------------------
  |  |   48|      0|  (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |   41|      0|#define CURLMULTI_MAGIC_NUMBER 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1020|      0|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (48:3): [True: 0, False: 0]
  |  |  |  Branch (48:5): [True: 0, False: 0]
  |  |  |  Branch (48:12): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1023|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (206:8): [True: 0, False: 0]
  |  Branch (206:8): [True: 0, False: 0]
  ------------------
  207|      0|      if(!Curl_multi_knows_easy(data->multi, data)) {
  ------------------
  |  Branch (207:10): [True: 0, False: 0]
  ------------------
  208|       |        /* But multi does not know it, something is fishy, better deny call */
  209|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:9): [Folded, False: 0]
  |  Branch (209:9): [Folded, False: 0]
  ------------------
  210|      0|        result = CURLE_BAD_FUNCTION_ARGUMENT;
  211|      0|        goto out;
  212|      0|      }
  213|      0|    }
  214|      0|    else {
  215|      0|      DEBUGASSERT(0); /* data needs to have a GOOD multi handle */
  ------------------
  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (215:7): [Folded, False: 0]
  |  Branch (215:7): [Folded, False: 0]
  ------------------
  216|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  217|      0|      goto out;
  218|      0|    }
  219|      0|  }
  220|    813|  else if(data->multi) {
  ------------------
  |  Branch (220:11): [True: 0, False: 813]
  ------------------
  221|      0|    DEBUGASSERT(0); /* data should not have a multi handle */
  ------------------
  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (221:5): [Folded, False: 0]
  |  Branch (221:5): [Folded, False: 0]
  ------------------
  222|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  223|      0|    goto out;
  224|      0|  }
  225|       |  /* verify that the call `fn` we're about to enter is known
  226|       |   * and check call properties to be admitting. */
  227|    813|  if(fn >= CURL_EAPI_FN_LAST) {
  ------------------
  |  Branch (227:6): [True: 0, False: 813]
  ------------------
  228|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  229|      0|    goto out;
  230|      0|  }
  231|    813|  fn_props = &eapi_fn_props[fn];
  232|    813|  DEBUGASSERT(fn_props->fn == fn);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (232:3): [True: 0, False: 813]
  |  Branch (232:3): [True: 813, False: 0]
  ------------------
  233|    813|  if(!fn_props->recurse) {
  ------------------
  |  Branch (233:6): [True: 813, False: 0]
  ------------------
  234|    813|    if(data->callstack.count) {
  ------------------
  |  Branch (234:8): [True: 0, False: 813]
  ------------------
  235|      0|#ifdef CURLVERBOSE
  236|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  237|      0|        "EAPI guard: calling %hu with call to %u ongoing\n", (uint16_t)fn,
  238|      0|        data->callstack.calls[data->callstack.count - 1]));
  239|      0|#endif
  240|      0|      result = CURLE_RECURSIVE_API_CALL;
  241|      0|      goto out;
  242|      0|    }
  243|    813|    if(data->multi && data->multi->callstack.count) {
  ------------------
  |  Branch (243:8): [True: 0, False: 813]
  |  Branch (243:23): [True: 0, False: 0]
  ------------------
  244|      0|#ifdef CURLVERBOSE
  245|       |
  246|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  247|      0|        "EAPI guard: calling %hu with multi call to %u ongoing\n",
  248|      0|        (uint16_t)fn,
  249|      0|        data->multi->callstack.calls[data->multi->callstack.count - 1]));
  250|      0|#endif
  251|      0|      result = CURLE_RECURSIVE_API_CALL;
  252|      0|      goto out;
  253|      0|    }
  254|    813|  }
  255|       |
  256|    813|  if(!fn_props->readonly && eapi_in_readonly_cb(data)) {
  ------------------
  |  Branch (256:6): [True: 813, False: 0]
  |  Branch (256:29): [True: 0, False: 813]
  ------------------
  257|       |    /* Not allowed to be invoked while an event cb is ongoing */
  258|      0|#ifdef CURLVERBOSE
  259|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  260|      0|        "EAPI guard: calling %hu in readonly enforcing callback\n",
  261|      0|        (uint16_t)fn));
  262|      0|#endif
  263|      0|    result = CURLE_RECURSIVE_API_CALL;
  264|      0|    goto out;
  265|      0|  }
  266|       |
  267|    813|#if defined(USE_SSL) && defined(USE_MUTEX)
  268|    813|  if(fn_props->no_scache_lock &&
  ------------------
  |  Branch (268:6): [True: 0, False: 813]
  ------------------
  269|      0|     Curl_ssl_scache_is_locked_by_current_thread(data)) {
  ------------------
  |  Branch (269:6): [True: 0, False: 0]
  ------------------
  270|      0|#ifdef CURLVERBOSE
  271|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  272|      0|        "EAPI guard: calling %hu while vtls_scache is locked by "
  273|      0|        "current thread\n", (uint16_t)fn));
  274|      0|#endif
  275|      0|    result = CURLE_RECURSIVE_API_CALL;
  276|      0|    goto out;
  277|      0|  }
  278|    813|#endif
  279|       |
  280|       |  /* all fine, add to data's callstack */
  281|    813|  if(data->callstack.count >= CURL_EAPI_MAX_RECURSION) {
  ------------------
  |  |  139|    813|#define CURL_EAPI_MAX_RECURSION       7
  ------------------
  |  Branch (281:6): [True: 0, False: 813]
  ------------------
  282|      0|    result = CURLE_RECURSIVE_API_CALL;
  283|      0|    goto out;
  284|      0|  }
  285|    813|  data->callstack.calls[data->callstack.count] = (uint16_t)fn;
  286|    813|  ++data->callstack.count;
  287|    813|  guard->depth = data->callstack.count;
  288|    813|  guard->data = fn_props->data_is_killed ? NULL : data;
  ------------------
  |  Branch (288:17): [True: 813, False: 0]
  ------------------
  289|       |
  290|    813|out:
  291|    813|  if(presult)
  ------------------
  |  Branch (291:6): [True: 0, False: 813]
  ------------------
  292|      0|    *presult = result;
  293|    813|  return guard->depth > 0;
  294|    813|}
Curl_eapi_leave:
  297|    813|{
  298|    813|  if(guard->depth) {
  ------------------
  |  Branch (298:6): [True: 813, False: 0]
  ------------------
  299|       |    /* guard->data is set when handle is supposed to stay alive during call */
  300|    813|    if(guard->data && GOOD_EASY_HANDLE(guard->data)) {
  ------------------
  |  |   34|      0|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|      0|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1020|      0|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:3): [True: 0, False: 0]
  |  |  |  Branch (34:5): [True: 0, False: 0]
  |  |  |  Branch (34:12): [True: 0, False: 0]
  |  |  ------------------
  |  |   35|      0|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1023|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (300:8): [True: 0, False: 813]
  |  Branch (300:23): [True: 0, False: 0]
  |  Branch (300:23): [True: 0, False: 0]
  ------------------
  301|      0|      if(guard->depth > guard->data->callstack.count) {
  ------------------
  |  Branch (301:10): [True: 0, False: 0]
  ------------------
  302|      0|        DEBUGASSERT(0); /* something very wrong */
  ------------------
  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (302:9): [Folded, False: 0]
  |  Branch (302:9): [Folded, False: 0]
  ------------------
  303|      0|      }
  304|      0|      else {
  305|      0|        if(guard->depth < guard->data->callstack.count) {
  ------------------
  |  Branch (305:12): [True: 0, False: 0]
  ------------------
  306|      0|          DEBUGASSERT(0); /* someone forgot to clean up */
  ------------------
  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (306:11): [Folded, False: 0]
  |  Branch (306:11): [Folded, False: 0]
  ------------------
  307|      0|        }
  308|       |        /* reset to depth the guard was entered in */
  309|      0|        guard->data->callstack.count = (uint16_t)(guard->depth - 1);
  310|      0|      }
  311|      0|    }
  312|    813|  }
  313|    813|}
api.c:eapi_in_readonly_cb:
  139|    813|{
  140|    813|  struct Curl_multi *multi = data->multi;
  141|    813|  if(multi && multi->callstack.count) {
  ------------------
  |  Branch (141:6): [True: 0, False: 813]
  |  Branch (141:15): [True: 0, False: 0]
  ------------------
  142|      0|    size_t i;
  143|      0|    for(i = 0; i < multi->callstack.count; ++i) {
  ------------------
  |  Branch (143:16): [True: 0, False: 0]
  ------------------
  144|      0|      if(multi->callstack.calls[i] >= CURL_CBAPI_FN_START) {
  ------------------
  |  |  102|      0|#define CURL_CBAPI_FN_START        128
  ------------------
  |  Branch (144:10): [True: 0, False: 0]
  ------------------
  145|      0|        uint8_t fn = multi->callstack.calls[i];
  146|      0|        if((fn < CURL_CBAPI_FN_LAST) &&
  ------------------
  |  Branch (146:12): [True: 0, False: 0]
  ------------------
  147|      0|           cbapi_fn_props[fn - CURL_CBAPI_FN_START].set_readonly)
  ------------------
  |  |  102|      0|#define CURL_CBAPI_FN_START        128
  ------------------
  |  Branch (147:12): [True: 0, False: 0]
  ------------------
  148|      0|          return TRUE;
  ------------------
  |  | 1020|      0|#define TRUE true
  ------------------
  149|      0|      }
  150|      0|    }
  151|      0|  }
  152|    813|  return FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  153|    813|}

Curl_bufref_init:
   38|  1.62k|{
   39|  1.62k|  DEBUGASSERT(br);
  ------------------
  |  | 1050|  1.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (39:3): [True: 0, False: 1.62k]
  |  Branch (39:3): [True: 1.62k, False: 0]
  ------------------
   40|  1.62k|  br->dtor = NULL;
   41|  1.62k|  br->ptr = NULL;
   42|  1.62k|  br->len = 0;
   43|       |
   44|  1.62k|#ifdef DEBUGBUILD
   45|  1.62k|  br->signature = SIGNATURE;
  ------------------
  |  |   31|  1.62k|#define SIGNATURE 0x5c48e9b2    /* Random pattern. */
  ------------------
   46|  1.62k|#endif
   47|  1.62k|}
Curl_bufref_free:
   55|  2.43k|{
   56|  2.43k|  DEBUGASSERT(br);
  ------------------
  |  | 1050|  2.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (56:3): [True: 0, False: 2.43k]
  |  Branch (56:3): [True: 2.43k, False: 0]
  ------------------
   57|  2.43k|  DEBUGASSERT(br->signature == SIGNATURE);
  ------------------
  |  | 1050|  2.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (57:3): [True: 0, False: 2.43k]
  |  Branch (57:3): [True: 2.43k, False: 0]
  ------------------
   58|  2.43k|  DEBUGASSERT(br->ptr || !br->len);
  ------------------
  |  | 1050|  2.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 2.43k, False: 0]
  |  Branch (58:3): [True: 0, False: 0]
  |  Branch (58:3): [True: 0, False: 2.43k]
  |  Branch (58:3): [True: 2.43k, False: 0]
  ------------------
   59|       |
   60|  2.43k|  if(br->ptr && br->dtor)
  ------------------
  |  Branch (60:6): [True: 0, False: 2.43k]
  |  Branch (60:17): [True: 0, False: 0]
  ------------------
   61|      0|    br->dtor(CURL_UNCONST(br->ptr));
  ------------------
  |  |  827|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   62|       |
   63|  2.43k|  br->dtor = NULL;
   64|       |  br->ptr = NULL;
   65|  2.43k|  br->len = 0;
   66|  2.43k|}

Curl_flush_cookies:
 1668|    813|{
 1669|    813|  Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1670|       |  /* only save the cookie file if a transfer was started (cookies->running is
 1671|       |     set), as otherwise the cookies were not completely initialized and there
 1672|       |     might be cookie files that were not loaded so saving the file is the
 1673|       |     wrong thing. */
 1674|    813|  if(data->cookies) {
  ------------------
  |  Branch (1674:6): [True: 0, False: 813]
  ------------------
 1675|      0|    const char *cookiejar = CURL_EASY_STR(data, STRING_COOKIEJAR);
  ------------------
  |  | 1224|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1676|      0|    if(cookiejar && data->cookies->running) {
  ------------------
  |  Branch (1676:8): [True: 0, False: 0]
  |  Branch (1676:21): [True: 0, False: 0]
  ------------------
 1677|       |      /* if we have a destination file for all the cookies to get dumped to */
 1678|      0|      CURLcode result = cookie_output(data, data->cookies, cookiejar);
 1679|      0|      if(result)
  ------------------
  |  Branch (1679:10): [True: 0, False: 0]
  ------------------
 1680|      0|        infof(data, "WARNING: failed to save cookies in %s: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1681|      0|              cookiejar, curl_easy_strerror(result));
 1682|      0|    }
 1683|       |
 1684|      0|    if(cleanup && (!data->share || (data->cookies != data->share->cookies))) {
  ------------------
  |  Branch (1684:8): [True: 0, False: 0]
  |  Branch (1684:20): [True: 0, False: 0]
  |  Branch (1684:36): [True: 0, False: 0]
  ------------------
 1685|      0|      Curl_cookie_cleanup(data->cookies);
 1686|       |      data->cookies = NULL;
 1687|      0|    }
 1688|      0|  }
 1689|    813|  Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1690|    813|}

Curl_creds_create:
   41|     86|{
   42|     86|  struct Curl_creds *creds = NULL;
   43|     86|  size_t ulen = user ? strlen(user) : 0;
  ------------------
  |  Branch (43:17): [True: 77, False: 9]
  ------------------
   44|     86|  size_t plen = passwd ? strlen(passwd) : 0;
  ------------------
  |  Branch (44:17): [True: 43, False: 43]
  ------------------
   45|     86|  size_t olen = oauth_bearer ? strlen(oauth_bearer) : 0;
  ------------------
  |  Branch (45:17): [True: 0, False: 86]
  ------------------
   46|     86|  size_t salen = sasl_authzid ? strlen(sasl_authzid) : 0;
  ------------------
  |  Branch (46:18): [True: 0, False: 86]
  ------------------
   47|     86|  size_t sslen = sasl_service ? strlen(sasl_service) : 0;
  ------------------
  |  Branch (47:18): [True: 0, False: 86]
  ------------------
   48|     86|  char *s, *buf;
   49|     86|  size_t bufsize;
   50|     86|  CURLcode result = CURLE_OK;
   51|       |
   52|     86|  Curl_creds_unlink(pcreds);
   53|       |
   54|       |  /* Everything empty/NULL, this is the NULL credential */
   55|     86|  if(!user && !passwd && !olen && !salen && !sslen)
  ------------------
  |  Branch (55:6): [True: 9, False: 77]
  |  Branch (55:15): [True: 0, False: 9]
  |  Branch (55:26): [True: 0, False: 0]
  |  Branch (55:35): [True: 0, False: 0]
  |  Branch (55:45): [True: 0, False: 0]
  ------------------
   56|      0|    goto out;
   57|       |
   58|     86|  if((ulen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|     86|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (58:6): [True: 0, False: 86]
  ------------------
   59|     86|     (plen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|     86|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (59:6): [True: 0, False: 86]
  ------------------
   60|     86|     (olen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|     86|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (60:6): [True: 0, False: 86]
  ------------------
   61|     86|     (salen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|     86|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (61:6): [True: 0, False: 86]
  ------------------
   62|     86|     (sslen > CURL_MAX_INPUT_LENGTH)) {
  ------------------
  |  |   45|     86|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (62:6): [True: 0, False: 86]
  ------------------
   63|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
   64|      0|    goto out;
   65|      0|  }
   66|       |
   67|       |  /* null-terminator for user already part of struct */
   68|     86|  bufsize = ulen + plen + 1 + olen + 1 + salen + 1 + sslen + 1;
   69|     86|  creds = curlx_calloc(1, sizeof(*creds) + bufsize);
  ------------------
  |  | 1512|     86|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   70|     86|  if(!creds) {
  ------------------
  |  Branch (70:6): [True: 0, False: 86]
  ------------------
   71|      0|    result = CURLE_OUT_OF_MEMORY;
   72|      0|    goto out;
   73|      0|  }
   74|       |
   75|     86|  creds->bufsize = bufsize;
   76|     86|  creds->refcount = 1;
   77|     86|  creds->source = source;
   78|       |  /* Some compilers try to be too smart about our dynamic struct size */
   79|     86|  buf = ((char *)creds) + offsetof(struct Curl_creds, buf);
   80|     86|  creds->user = s = buf;
   81|     86|  if(ulen)
  ------------------
  |  Branch (81:6): [True: 66, False: 20]
  ------------------
   82|     66|    memcpy(s, user, ulen + 1);
   83|     86|  creds->passwd = s = buf + ulen + 1;
   84|     86|  if(plen)
  ------------------
  |  Branch (84:6): [True: 40, False: 46]
  ------------------
   85|     40|    memcpy(s, passwd, plen + 1);
   86|     86|  creds->oauth_bearer = s = buf + ulen + 1 + plen + 1;
   87|     86|  if(olen)
  ------------------
  |  Branch (87:6): [True: 0, False: 86]
  ------------------
   88|      0|    memcpy(s, oauth_bearer, olen + 1);
   89|     86|  creds->sasl_authzid = s = buf + ulen + 1 + plen + 1 + olen + 1;
   90|     86|  if(salen)
  ------------------
  |  Branch (90:6): [True: 0, False: 86]
  ------------------
   91|      0|    memcpy(s, sasl_authzid, salen + 1);
   92|     86|  creds->sasl_service = s = buf + ulen + 1 + plen + 1 + olen + 1 + salen + 1;
   93|     86|  if(sslen)
  ------------------
  |  Branch (93:6): [True: 0, False: 86]
  ------------------
   94|      0|    memcpy(s, sasl_service, sslen + 1);
   95|       |
   96|     86|out:
   97|     86|  if(!result)
  ------------------
  |  Branch (97:6): [True: 86, False: 0]
  ------------------
   98|     86|    *pcreds = creds;
   99|      0|  else
  100|      0|    Curl_creds_unlink(&creds);
  101|     86|  return result;
  102|     86|}
Curl_creds_link:
  131|     86|{
  132|     86|  if(*pdest != src) {
  ------------------
  |  Branch (132:6): [True: 86, False: 0]
  ------------------
  133|     86|    Curl_creds_unlink(pdest);
  134|     86|    *pdest = src;
  135|     86|    if(src) {
  ------------------
  |  Branch (135:8): [True: 86, False: 0]
  ------------------
  136|     86|      DEBUGASSERT(src->refcount < UINT32_MAX);
  ------------------
  |  | 1050|     86|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (136:7): [True: 0, False: 86]
  |  Branch (136:7): [True: 86, False: 0]
  ------------------
  137|     86|      src->refcount++;
  138|     86|    }
  139|     86|  }
  140|     86|}
Curl_creds_unlink:
  143|  6.57k|{
  144|  6.57k|  if(*pcreds) {
  ------------------
  |  Branch (144:6): [True: 172, False: 6.40k]
  ------------------
  145|    172|    struct Curl_creds *creds = *pcreds;
  146|       |
  147|    172|    DEBUGASSERT(creds->refcount);
  ------------------
  |  | 1050|    172|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (147:5): [True: 0, False: 172]
  |  Branch (147:5): [True: 172, False: 0]
  ------------------
  148|    172|    *pcreds = NULL;
  149|    172|    if(creds->refcount)
  ------------------
  |  Branch (149:8): [True: 172, False: 0]
  ------------------
  150|    172|      creds->refcount--;
  151|    172|    if(!creds->refcount) {
  ------------------
  |  Branch (151:8): [True: 86, False: 86]
  ------------------
  152|     86|      curlx_memzero(creds, sizeof(*creds) + creds->bufsize);
  153|     86|      curlx_free(creds);
  ------------------
  |  | 1515|     86|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  154|     86|    }
  155|    172|  }
  156|  6.57k|}

Curl_get_line:
   36|  68.6k|{
   37|  68.6k|  CURLcode result;
   38|  68.6k|  char buffer[128];
   39|  68.6k|  curlx_dyn_reset(buf);
   40|  83.7k|  while(1) {
  ------------------
  |  Branch (40:9): [True: 83.7k, Folded]
  ------------------
   41|  83.7k|    size_t rlen;
   42|  83.7k|    const char *b = fgets(buffer, sizeof(buffer), input);
   43|  83.7k|    if(!b && ferror(input))
  ------------------
  |  Branch (43:8): [True: 107, False: 83.6k]
  |  Branch (43:14): [True: 0, False: 107]
  ------------------
   44|      0|      return CURLE_READ_ERROR;
   45|       |
   46|  83.7k|    *eof = feof(input);
   47|       |
   48|  83.7k|    rlen = b ? strlen(b) : 0;
  ------------------
  |  Branch (48:12): [True: 83.6k, False: 107]
  ------------------
   49|  83.7k|    if(rlen) {
  ------------------
  |  Branch (49:8): [True: 83.0k, False: 683]
  ------------------
   50|  83.0k|      result = curlx_dyn_addn(buf, b, rlen);
   51|  83.0k|      if(result)
  ------------------
  |  Branch (51:10): [True: 3, False: 83.0k]
  ------------------
   52|       |        /* too long line or out of memory */
   53|      3|        return result;
   54|  83.0k|    }
   55|       |    /* now check the full line */
   56|  83.7k|    rlen = curlx_dyn_len(buf);
   57|  83.7k|    b = curlx_dyn_ptr(buf);
   58|  83.7k|    if(rlen && (b[rlen - 1] == '\n'))
  ------------------
  |  Branch (58:8): [True: 83.2k, False: 481]
  |  Branch (58:16): [True: 67.8k, False: 15.3k]
  ------------------
   59|       |      /* LF at end of the line */
   60|  67.8k|      return CURLE_OK; /* all good */
   61|  15.8k|    if(*eof)
  ------------------
  |  Branch (61:8): [True: 810, False: 15.0k]
  ------------------
   62|       |      /* append a newline */
   63|    810|      return curlx_dyn_addn(buf, "\n", 1);
   64|       |    /* otherwise get next line to append */
   65|  15.8k|  }
   66|       |  /* UNREACHABLE */
   67|  68.6k|}

Curl_share_lock_share:
  378|    813|{
  379|    813|  if(!share)
  ------------------
  |  Branch (379:6): [True: 813, False: 0]
  ------------------
  380|    813|    return CURLSHE_INVALID;
  381|       |
  382|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (382:6): [True: 0, False: 0]
  ------------------
  383|      0|     share->lockfunc) /* only call this if set! */
  ------------------
  |  Branch (383:6): [True: 0, False: 0]
  ------------------
  384|      0|    share->lockfunc(data, type, accesstype, share->clientdata);
  385|       |  /* else if we do not share this, pretend successful lock */
  386|       |
  387|      0|  return CURLSHE_OK;
  388|    813|}
Curl_share_lock:
  392|    813|{
  393|    813|  return Curl_share_lock_share(data->share, data, type, accesstype);
  394|    813|}
Curl_share_unlock_share:
  399|    813|{
  400|    813|  if(!share)
  ------------------
  |  Branch (400:6): [True: 813, False: 0]
  ------------------
  401|    813|    return CURLSHE_INVALID;
  402|       |
  403|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (403:6): [True: 0, False: 0]
  ------------------
  404|      0|     share->unlockfunc) /* only call this if set! */
  ------------------
  |  Branch (404:6): [True: 0, False: 0]
  ------------------
  405|      0|    share->unlockfunc(data, type, share->clientdata);
  406|       |
  407|      0|  return CURLSHE_OK;
  408|    813|}
Curl_share_unlock:
  411|    813|{
  412|    813|  return Curl_share_unlock_share(data->share, data, type);
  413|    813|}
Curl_share_easy_unlink:
  416|    813|{
  417|    813|  struct Curl_share *share = data->share;
  418|       |
  419|    813|  if(share) {
  ------------------
  |  Branch (419:6): [True: 0, False: 813]
  ------------------
  420|      0|    bool locked = share_lock_acquire(share, data);
  421|       |
  422|       |    /* If share caches connections, detach any existing connection and
  423|       |     * forget its identifier. */
  424|      0|    if((share->specifier & (1 << CURL_LOCK_DATA_CONNECT))) {
  ------------------
  |  Branch (424:8): [True: 0, False: 0]
  ------------------
  425|      0|      if(data->conn)
  ------------------
  |  Branch (425:10): [True: 0, False: 0]
  ------------------
  426|      0|        Curl_detach_connection(data);
  427|      0|      data->state.last_conn_id = -1;
  428|      0|      data->state.last_cpid = UINT32_MAX;
  429|      0|    }
  430|       |
  431|      0|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
  432|      0|    if(share->cookies == data->cookies)
  ------------------
  |  Branch (432:8): [True: 0, False: 0]
  ------------------
  433|      0|      data->cookies = NULL;
  434|      0|#endif
  435|       |
  436|      0|#ifndef CURL_DISABLE_HSTS
  437|      0|    if(share->hsts == data->hsts)
  ------------------
  |  Branch (437:8): [True: 0, False: 0]
  ------------------
  438|      0|      data->hsts = NULL;
  439|      0|#endif
  440|       |#ifdef USE_LIBPSL
  441|       |    if(&share->psl == data->psl)
  442|       |      data->psl = data->multi ? &data->multi->psl : NULL;
  443|       |#endif
  444|       |
  445|      0|    share_unlink(&data->share, data, locked);
  446|      0|  }
  447|    813|  return CURLE_OK;
  448|    813|}

Curl_trc_opt:
  671|      2|{
  672|      2|  CURLcode result = config ? trc_opt(config) : CURLE_OK;
  ------------------
  |  Branch (672:21): [True: 0, False: 2]
  ------------------
  673|      2|#ifdef DEBUGBUILD
  674|       |  /* CURL_DEBUG can override anything */
  675|      2|  if(!result) {
  ------------------
  |  Branch (675:6): [True: 2, False: 0]
  ------------------
  676|      2|    const char *dbg_config = getenv("CURL_DEBUG");
  677|      2|    if(dbg_config)
  ------------------
  |  Branch (677:8): [True: 0, False: 2]
  ------------------
  678|      0|      result = trc_opt(dbg_config);
  679|      2|  }
  680|      2|#endif /* DEBUGBUILD */
  681|      2|  return result;
  682|      2|}
Curl_trc_init:
  685|      2|{
  686|      2|#ifdef DEBUGBUILD
  687|      2|  return Curl_trc_opt(NULL);
  688|       |#else
  689|       |  return CURLE_OK;
  690|       |#endif
  691|      2|}

curlx_dyn_init:
   39|  4.05k|{
   40|  4.05k|  DEBUGASSERT(s);
  ------------------
  |  | 1050|  4.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (40:3): [True: 0, False: 4.05k]
  |  Branch (40:3): [True: 4.05k, False: 0]
  ------------------
   41|  4.05k|  DEBUGASSERT(toobig);
  ------------------
  |  | 1050|  4.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (41:3): [True: 0, False: 4.05k]
  |  Branch (41:3): [True: 4.05k, False: 0]
  ------------------
   42|  4.05k|  DEBUGASSERT(toobig <= MAX_DYNBUF_SIZE); /* catch crazy mistakes */
  ------------------
  |  | 1050|  4.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (42:3): [True: 0, False: 4.05k]
  |  Branch (42:3): [True: 4.05k, False: 0]
  ------------------
   43|  4.05k|  s->bufr = NULL;
   44|  4.05k|  s->leng = 0;
   45|  4.05k|  s->allc = 0;
   46|  4.05k|  s->toobig = toobig;
   47|  4.05k|#ifdef DEBUGBUILD
   48|  4.05k|  s->init = DYNINIT;
  ------------------
  |  |   32|  4.05k|#define DYNINIT 0xbee51da /* random pattern */
  ------------------
   49|  4.05k|#endif
   50|  4.05k|}
curlx_dyn_free:
   57|  4.09k|{
   58|  4.09k|  DEBUGASSERT(s);
  ------------------
  |  | 1050|  4.09k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 0, False: 4.09k]
  |  Branch (58:3): [True: 4.09k, False: 0]
  ------------------
   59|  4.09k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1050|  4.09k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (59:3): [True: 0, False: 4.09k]
  |  Branch (59:3): [True: 4.09k, False: 0]
  ------------------
   60|  4.09k|  curlx_safefree(s->bufr);
  ------------------
  |  | 1371|  4.09k|  do {                      \
  |  | 1372|  4.09k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  4.09k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  4.09k|    (ptr) = NULL;           \
  |  | 1374|  4.09k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 4.09k]
  |  |  ------------------
  ------------------
   61|  4.09k|  s->leng = s->allc = 0;
   62|  4.09k|}
curlx_dyn_reset:
  126|  97.8k|{
  127|  97.8k|  DEBUGASSERT(s);
  ------------------
  |  | 1050|  97.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (127:3): [True: 0, False: 97.8k]
  |  Branch (127:3): [True: 97.8k, False: 0]
  ------------------
  128|  97.8k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1050|  97.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (128:3): [True: 0, False: 97.8k]
  |  Branch (128:3): [True: 97.8k, False: 0]
  ------------------
  129|  97.8k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1050|  97.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (129:3): [True: 97.8k, False: 0]
  |  Branch (129:3): [True: 0, False: 0]
  |  Branch (129:3): [True: 25.7k, False: 72.1k]
  |  Branch (129:3): [True: 72.1k, False: 0]
  ------------------
  130|  97.8k|  if(s->leng)
  ------------------
  |  Branch (130:6): [True: 72.1k, False: 25.7k]
  ------------------
  131|  72.1k|    s->bufr[0] = 0;
  132|  97.8k|  s->leng = 0;
  133|  97.8k|}
curlx_dyn_addn:
  163|   234k|{
  164|   234k|  DEBUGASSERT(s);
  ------------------
  |  | 1050|   234k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (164:3): [True: 0, False: 234k]
  |  Branch (164:3): [True: 234k, False: 0]
  ------------------
  165|   234k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1050|   234k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (165:3): [True: 0, False: 234k]
  |  Branch (165:3): [True: 234k, False: 0]
  ------------------
  166|   234k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1050|   234k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 234k, False: 0]
  |  Branch (166:3): [True: 0, False: 0]
  |  Branch (166:3): [True: 76.7k, False: 157k]
  |  Branch (166:3): [True: 157k, False: 0]
  ------------------
  167|   234k|  return dyn_nappend(s, mem, len);
  168|   234k|}
curlx_dyn_add:
  174|  68.4k|{
  175|  68.4k|  size_t n;
  176|  68.4k|  DEBUGASSERT(str);
  ------------------
  |  | 1050|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (176:3): [True: 0, False: 68.4k]
  |  Branch (176:3): [True: 68.4k, False: 0]
  ------------------
  177|  68.4k|  DEBUGASSERT(s);
  ------------------
  |  | 1050|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (177:3): [True: 0, False: 68.4k]
  |  Branch (177:3): [True: 68.4k, False: 0]
  ------------------
  178|  68.4k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1050|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 0, False: 68.4k]
  |  Branch (178:3): [True: 68.4k, False: 0]
  ------------------
  179|  68.4k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1050|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 68.4k, False: 0]
  |  Branch (179:3): [True: 0, False: 0]
  |  Branch (179:3): [True: 813, False: 67.6k]
  |  Branch (179:3): [True: 67.6k, False: 0]
  ------------------
  180|  68.4k|  n = strlen(str);
  181|  68.4k|  return dyn_nappend(s, (const unsigned char *)str, n);
  182|  68.4k|}
curlx_dyn_ptr:
  238|   159k|{
  239|   159k|  DEBUGASSERT(s);
  ------------------
  |  | 1050|   159k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (239:3): [True: 0, False: 159k]
  |  Branch (239:3): [True: 159k, False: 0]
  ------------------
  240|   159k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1050|   159k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (240:3): [True: 0, False: 159k]
  |  Branch (240:3): [True: 159k, False: 0]
  ------------------
  241|   159k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1050|   159k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (241:3): [True: 159k, False: 0]
  |  Branch (241:3): [True: 0, False: 0]
  |  Branch (241:3): [True: 2.71k, False: 156k]
  |  Branch (241:3): [True: 156k, False: 0]
  ------------------
  242|   159k|  return s->bufr;
  243|   159k|}
curlx_dyn_len:
  272|  84.5k|{
  273|  84.5k|  DEBUGASSERT(s);
  ------------------
  |  | 1050|  84.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 84.5k]
  |  Branch (273:3): [True: 84.5k, False: 0]
  ------------------
  274|  84.5k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1050|  84.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (274:3): [True: 0, False: 84.5k]
  |  Branch (274:3): [True: 84.5k, False: 0]
  ------------------
  275|  84.5k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1050|  84.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (275:3): [True: 84.5k, False: 0]
  |  Branch (275:3): [True: 0, False: 0]
  |  Branch (275:3): [True: 481, False: 84.0k]
  |  Branch (275:3): [True: 84.0k, False: 0]
  ------------------
  276|  84.5k|  return s->leng;
  277|  84.5k|}
dynbuf.c:dyn_nappend:
   69|   303k|{
   70|   303k|  size_t idx = s->leng;
   71|   303k|  size_t a = s->allc;
   72|   303k|  size_t fit = len + idx + 1; /* new string + old string + zero byte */
   73|       |
   74|       |  /* try to detect if there is rubbish in the struct */
   75|   303k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1050|   303k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (75:3): [True: 0, False: 303k]
  |  Branch (75:3): [True: 303k, False: 0]
  ------------------
   76|   303k|  DEBUGASSERT(s->toobig);
  ------------------
  |  | 1050|   303k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 303k]
  |  Branch (76:3): [True: 303k, False: 0]
  ------------------
   77|   303k|  DEBUGASSERT(idx < s->toobig);
  ------------------
  |  | 1050|   303k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 303k]
  |  Branch (77:3): [True: 303k, False: 0]
  ------------------
   78|   303k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1050|   303k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (78:3): [True: 303k, False: 0]
  |  Branch (78:3): [True: 0, False: 0]
  |  Branch (78:3): [True: 77.5k, False: 225k]
  |  Branch (78:3): [True: 225k, False: 0]
  ------------------
   79|   303k|  DEBUGASSERT(a <= s->toobig);
  ------------------
  |  | 1050|   303k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (79:3): [True: 0, False: 303k]
  |  Branch (79:3): [True: 303k, False: 0]
  ------------------
   80|   303k|  DEBUGASSERT(!len || mem);
  ------------------
  |  | 1050|   303k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (80:3): [True: 303k, False: 0]
  |  Branch (80:3): [True: 0, False: 0]
  |  Branch (80:3): [True: 3.81k, False: 299k]
  |  Branch (80:3): [True: 299k, False: 0]
  ------------------
   81|       |
   82|   303k|  if(fit > s->toobig) {
  ------------------
  |  Branch (82:6): [True: 30, False: 302k]
  ------------------
   83|     30|    curlx_dyn_free(s);
   84|     30|    return CURLE_TOO_LARGE;
   85|     30|  }
   86|   302k|  else if(!a) {
  ------------------
  |  Branch (86:11): [True: 2.05k, False: 300k]
  ------------------
   87|  2.05k|    DEBUGASSERT(!idx);
  ------------------
  |  | 1050|  2.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:5): [True: 0, False: 2.05k]
  |  Branch (87:5): [True: 2.05k, False: 0]
  ------------------
   88|       |    /* first invoke */
   89|  2.05k|    if(MIN_FIRST_ALLOC > s->toobig)
  ------------------
  |  |   29|  2.05k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (89:8): [True: 0, False: 2.05k]
  ------------------
   90|      0|      a = s->toobig;
   91|  2.05k|    else if(fit < MIN_FIRST_ALLOC)
  ------------------
  |  |   29|  2.05k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (91:13): [True: 1.96k, False: 96]
  ------------------
   92|  1.96k|      a = MIN_FIRST_ALLOC;
  ------------------
  |  |   29|  1.96k|#define MIN_FIRST_ALLOC 32
  ------------------
   93|     96|    else
   94|     96|      a = fit;
   95|  2.05k|  }
   96|   300k|  else {
   97|   304k|    while(a < fit)
  ------------------
  |  Branch (97:11): [True: 3.78k, False: 300k]
  ------------------
   98|  3.78k|      a *= 2;
   99|   300k|    if(a > s->toobig)
  ------------------
  |  Branch (99:8): [True: 19, False: 300k]
  ------------------
  100|       |      /* no point in allocating a larger buffer than this is allowed to use */
  101|     19|      a = s->toobig;
  102|   300k|  }
  103|       |
  104|   302k|  if(a != s->allc) {
  ------------------
  |  Branch (104:6): [True: 4.42k, False: 298k]
  ------------------
  105|  4.42k|    void *p = curlx_realloc(s->bufr, a);
  ------------------
  |  | 1514|  4.42k|  curl_dbg_realloc(ptr, size, __LINE__, __FILE__)
  ------------------
  106|  4.42k|    if(!p) {
  ------------------
  |  Branch (106:8): [True: 0, False: 4.42k]
  ------------------
  107|      0|      curlx_dyn_free(s);
  108|      0|      return CURLE_OUT_OF_MEMORY;
  109|      0|    }
  110|  4.42k|    s->bufr = p;
  111|  4.42k|    s->allc = a;
  112|  4.42k|  }
  113|       |
  114|   302k|  if(len)
  ------------------
  |  Branch (114:6): [True: 299k, False: 3.81k]
  ------------------
  115|   299k|    memcpy(&s->bufr[idx], mem, len);
  116|   302k|  s->leng = idx + len;
  117|   302k|  s->bufr[s->leng] = 0;
  118|   302k|  return CURLE_OK;
  119|   302k|}

curlx_memzero:
  113|    899|{
  114|    899|  if(buf)
  ------------------
  |  Branch (114:6): [True: 899, False: 0]
  ------------------
  115|    899|    curlx_memzero_low(buf, size);
  ------------------
  |  | 1689|    899|#define curlx_memzero_low(buf, size)  explicit_bzero(buf, size)
  ------------------
  116|    899|}

curlx_str_passblanks:
  319|   110k|{
  320|   127k|  while(ISBLANK(**linep))
  ------------------
  |  |   43|   127k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 15.9k, False: 111k]
  |  |  |  Branch (43:38): [True: 806, False: 110k]
  |  |  ------------------
  ------------------
  321|  16.7k|    (*linep)++; /* move over it */
  322|   110k|}

curlx_uztosi:
   69|      4|{
   70|      4|  DEBUGASSERT(uznum <= (size_t)CURL_MASK_SINT);
  ------------------
  |  | 1050|      4|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (70:3): [True: 0, False: 4]
  |  Branch (70:3): [True: 4, False: 0]
  ------------------
   71|      4|  return (int)(uznum & (size_t)CURL_MASK_SINT);
  ------------------
  |  |   44|      4|#define CURL_MASK_SINT    (CURL_MASK_UINT >> 1)
  |  |  ------------------
  |  |  |  |   43|      4|#define CURL_MASK_UINT    ((unsigned int)~0)
  |  |  ------------------
  ------------------
   72|      4|}

curl_global_init:
  234|      2|{
  235|      2|  CURLcode result;
  236|      2|  global_init_lock();
  ------------------
  |  |   92|      2|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  237|       |
  238|      2|  result = global_init(flags, TRUE);
  ------------------
  |  | 1020|      2|#define TRUE true
  ------------------
  239|       |
  240|      2|  global_init_unlock();
  ------------------
  |  |   93|      2|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  241|       |
  242|      2|  return result;
  243|      2|}
curl_easy_init:
  369|    813|{
  370|    813|  CURLcode result;
  371|    813|  struct Curl_easy *data;
  372|       |
  373|       |  /* Make sure we inited the global SSL stuff */
  374|    813|  global_init_lock();
  ------------------
  |  |   92|    813|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  375|       |
  376|    813|  if(!initialized) {
  ------------------
  |  Branch (376:6): [True: 0, False: 813]
  ------------------
  377|      0|    result = global_init(CURL_GLOBAL_DEFAULT, TRUE);
  ------------------
  |  | 3049|      0|#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
  |  |  ------------------
  |  |  |  | 3047|      0|#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 3044|      0|#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 3045|      0|#define CURL_GLOBAL_WINSOCK (1 << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  result = global_init(CURL_GLOBAL_DEFAULT, TRUE);
  ------------------
  |  | 1020|      0|#define TRUE true
  ------------------
  378|      0|    if(result) {
  ------------------
  |  Branch (378:8): [True: 0, False: 0]
  ------------------
  379|       |      /* something in the global init failed, return nothing */
  380|      0|      DEBUGF(curl_mfprintf(stderr, "Error: curl_global_init failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  381|      0|      global_init_unlock();
  ------------------
  |  |   93|      0|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  382|      0|      return NULL;
  383|      0|    }
  384|      0|  }
  385|    813|  global_init_unlock();
  ------------------
  |  |   93|    813|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  386|       |
  387|       |  /* We use Curl_open() with undefined URL so far */
  388|    813|  result = Curl_open(&data);
  389|    813|  if(result) {
  ------------------
  |  Branch (389:6): [True: 0, False: 813]
  ------------------
  390|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_open failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  391|      0|    return NULL;
  392|      0|  }
  393|       |
  394|    813|  return data;
  395|    813|}
curl_easy_cleanup:
  884|    813|{
  885|    813|  struct Curl_eapi_guard guard;
  886|       |
  887|    813|  if(CURL_EAPI_ENTER(&guard, curl, easy_cleanup, NULL)) {
  ------------------
  |  |  163|    813|  Curl_eapi_enter((g), (curl), CURL_EAPI_FN_##fn, (r)) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 813, False: 0]
  |  |  |  Branch (163:59): [True: 813, False: 0]
  |  |  ------------------
  ------------------
  888|    813|    struct Curl_easy *data = curl;
  889|    813|    struct Curl_sigpipe_ctx sigpipe_ctx;
  890|    813|    sigpipe_ignore(data, &sigpipe_ctx);
  891|    813|    Curl_close(&data);
  892|    813|    sigpipe_restore(&sigpipe_ctx);
  893|    813|  }
  894|    813|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|    813|  Curl_eapi_leave(g)
  ------------------
  895|    813|}
easy.c:global_init:
  130|      2|{
  131|      2|  (void)flags;
  132|       |
  133|      2|  if(initialized++)
  ------------------
  |  Branch (133:6): [True: 0, False: 2]
  ------------------
  134|      0|    return CURLE_OK;
  135|       |
  136|      2|  if(memoryfuncs) {
  ------------------
  |  Branch (136:6): [True: 2, False: 0]
  ------------------
  137|       |    /* Setup the default memory functions here (again) */
  138|      2|    Curl_cmalloc = (curl_malloc_callback)malloc;
  139|      2|    Curl_cfree = (curl_free_callback)free;
  140|      2|    Curl_crealloc = (curl_realloc_callback)realloc;
  141|      2|    Curl_cstrdup = (curl_strdup_callback)CURLX_STRDUP_LOW;
  ------------------
  |  | 1504|      2|#define CURLX_STRDUP_LOW strdup
  ------------------
  142|      2|    Curl_ccalloc = (curl_calloc_callback)calloc;
  143|      2|  }
  144|       |
  145|       |#ifdef _WIN32
  146|       |  curlx_verify_windows_init();
  147|       |  curlx_now_init();
  148|       |#endif
  149|       |
  150|      2|  if(Curl_trc_init()) {
  ------------------
  |  Branch (150:6): [True: 0, False: 2]
  ------------------
  151|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_trc_init failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  152|      0|    goto fail;
  153|      0|  }
  154|       |
  155|       |#ifdef USE_WINDOWS_SSPI
  156|       |  if(Curl_sspi_global_init()) {
  157|       |    DEBUGF(curl_mfprintf(stderr, "Error: Curl_sspi_global_init() failed\n"));
  158|       |    goto fail;
  159|       |  }
  160|       |#endif
  161|       |
  162|       |#ifdef USE_WINSOCK
  163|       |  /* CURL_GLOBAL_WINSOCK controls the *optional* part of the Windows
  164|       |     initialization which is for the Windows sockets library (Winsock). */
  165|       |  if(flags & CURL_GLOBAL_WINSOCK) {
  166|       |    WSADATA wsa;
  167|       |    if(WSAStartup(MAKEWORD(2, 2), &wsa)) {
  168|       |      DEBUGF(curl_mfprintf(stderr, "Error: WSAStartup() failed\n"));
  169|       |      goto fail;
  170|       |    }
  171|       |    winsock_initialized = TRUE;
  172|       |  }
  173|       |#endif
  174|       |
  175|      2|  if(!Curl_ssl_init()) {
  ------------------
  |  Branch (175:6): [True: 0, False: 2]
  ------------------
  176|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssl_init failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  177|      0|    goto fail;
  178|      0|  }
  179|       |
  180|      2|  if(Curl_hash_global_init()) {
  ------------------
  |  Branch (180:6): [True: 0, False: 2]
  ------------------
  181|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_hash_global_init failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  182|      0|    goto fail;
  183|      0|  }
  184|       |
  185|      2|  if(!Curl_vquic_init()) {
  ------------------
  |  |   84|      2|#define Curl_vquic_init() 1
  ------------------
  |  Branch (185:6): [Folded, False: 2]
  ------------------
  186|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_vquic_init failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  187|      0|    goto fail;
  188|      0|  }
  189|       |
  190|      2|  if(Curl_amiga_init()) {
  ------------------
  |  |   36|      2|#define Curl_amiga_init()    CURLE_OK
  |  |  ------------------
  |  |  |  Branch (36:30): [Folded, False: 2]
  |  |  ------------------
  ------------------
  191|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_amiga_init failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  192|      0|    goto fail;
  193|      0|  }
  194|       |
  195|      2|  if(Curl_macos_init()) {
  ------------------
  |  |   31|      2|#define Curl_macos_init() CURLE_OK
  |  |  ------------------
  |  |  |  Branch (31:27): [Folded, False: 2]
  |  |  ------------------
  ------------------
  196|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_macos_init failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  197|      0|    goto fail;
  198|      0|  }
  199|       |
  200|      2|  if(Curl_async_global_init()) {
  ------------------
  |  Branch (200:6): [True: 0, False: 2]
  ------------------
  201|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_async_global_init failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  202|      0|    goto fail;
  203|      0|  }
  204|       |
  205|      2|  if(Curl_ssh_init()) {
  ------------------
  |  |  259|      2|#define Curl_ssh_init() 0
  |  |  ------------------
  |  |  |  Branch (259:25): [Folded, False: 2]
  |  |  ------------------
  ------------------
  206|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssh_init failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  207|      0|    goto fail;
  208|      0|  }
  209|       |
  210|      2|#ifdef DEBUGBUILD
  211|      2|  if(getenv("CURL_GLOBAL_INIT"))
  ------------------
  |  Branch (211:6): [True: 0, False: 2]
  ------------------
  212|       |    /* alloc data that will leak if *cleanup() is not called! */
  213|      0|    leakpointer = curlx_malloc(1);
  ------------------
  |  | 1510|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  214|      2|#endif
  215|       |
  216|      2|  return CURLE_OK;
  217|       |
  218|      0|fail:
  219|       |#ifdef USE_WINSOCK
  220|       |  if(winsock_initialized) {
  221|       |    WSACleanup();
  222|       |    winsock_initialized = FALSE;
  223|       |  }
  224|       |#endif
  225|      0|  initialized--; /* undo the increase */
  226|      0|  return CURLE_FAILED_INIT;
  227|      2|}

easy.c:curl_simple_lock_lock:
   64|    815|{
   65|    815|  for(;;) {
   66|    815|    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
  ------------------
  |  Branch (66:8): [True: 815, False: 0]
  ------------------
   67|    815|      break;
   68|       |    /* Reduce cache coherency traffic */
   69|      0|    while(atomic_load_explicit(lock, memory_order_relaxed)) {
  ------------------
  |  Branch (69:11): [True: 0, False: 0]
  ------------------
   70|       |      /* Reduce load (not mandatory) */
   71|      0|#ifdef HAVE_BUILTIN_IA32_PAUSE
   72|      0|      __builtin_ia32_pause();
   73|       |#elif defined(__aarch64__)
   74|       |      /* NOLINTNEXTLINE(portability-no-assembler) */
   75|       |      __asm__ volatile("yield" ::: "memory");
   76|       |#elif defined(HAVE_SCHED_YIELD)
   77|       |      sched_yield();
   78|       |#endif
   79|      0|    }
   80|      0|  }
   81|    815|}
easy.c:curl_simple_lock_unlock:
   84|    815|{
   85|    815|  atomic_store_explicit(lock, false, memory_order_release);
   86|    815|}

Curl_wildcard_dtor:
  189|    813|{
  190|    813|  struct WildcardData *wc = *wcp;
  191|    813|  if(!wc)
  ------------------
  |  Branch (191:6): [True: 813, False: 0]
  ------------------
  192|    813|    return;
  193|       |
  194|      0|  if(wc->dtor) {
  ------------------
  |  Branch (194:6): [True: 0, False: 0]
  ------------------
  195|      0|    wc->dtor(wc->ftpwc);
  196|      0|    wc->dtor = ZERO_NULL;
  ------------------
  |  | 1197|      0|#define ZERO_NULL 0
  ------------------
  197|      0|    wc->ftpwc = NULL;
  198|      0|  }
  199|      0|  DEBUGASSERT(!wc->ftpwc);
  ------------------
  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (199:3): [True: 0, False: 0]
  |  Branch (199:3): [True: 0, False: 0]
  ------------------
  200|       |
  201|      0|  Curl_llist_destroy(&wc->filelist, NULL);
  202|      0|  curlx_safefree(wc->path);
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  203|      0|  curlx_safefree(wc->pattern);
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  204|      0|  wc->state = CURLWC_INIT;
  205|      0|  curlx_free(wc);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  206|       |  *wcp = NULL;
  207|      0|}

Curl_initinfo:
   43|    813|{
   44|    813|  struct Progress *pro = &data->progress;
   45|    813|  struct PureInfo *info = &data->info;
   46|       |
   47|    813|  memset(&pro->delta, 0, sizeof(pro->delta));
   48|    813|  memset(&pro->total, 0, sizeof(pro->total));
   49|    813|  pro->startransfer_added = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
   50|       |
   51|    813|  info->httpcode = 0;
   52|    813|  info->httpproxycode = 0;
   53|    813|  info->httpversion = 0;
   54|    813|  info->filetime = -1; /* -1 is an illegal time and thus means unknown */
   55|    813|  info->timecond = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
   56|       |
   57|    813|  info->header_size = 0;
   58|    813|  info->request_size = 0;
   59|    813|  info->proxyauthavail = 0;
   60|    813|  info->httpauthavail = 0;
   61|    813|  info->proxyauthpicked = 0;
   62|    813|  info->httpauthpicked = 0;
   63|    813|  info->numconnects = 0;
   64|       |
   65|    813|  curlx_safefree(info->contenttype);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
   66|    813|  curlx_safefree(info->wouldredirect);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
   67|    813|  curlx_safefree(info->effective_url);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
   68|       |
   69|    813|  memset(&info->primary, 0, sizeof(info->primary));
   70|    813|  info->retry_after = 0;
   71|       |
   72|    813|  info->conn_scheme = 0;
   73|    813|  info->conn_protocol = 0;
   74|    813|  info->used_proxy = 0;
   75|       |
   76|    813|#ifdef USE_SSL
   77|    813|  Curl_ssl_free_certinfo(data);
   78|    813|#endif
   79|    813|}

Curl_hash_global_init:
   60|      2|{
   61|      2|  static bool seeded;
   62|      2|  unsigned char buf[sizeof(size_t)];
   63|      2|  size_t seed = 0;
   64|      2|  size_t i;
   65|      2|  CURLcode result;
   66|       |
   67|      2|  if(seeded)
  ------------------
  |  Branch (67:6): [True: 0, False: 2]
  ------------------
   68|      0|    return CURLE_OK;
   69|       |
   70|      2|  result = Curl_rand_bytes(NULL,
   71|      2|#ifdef DEBUGBUILD
   72|      2|                           FALSE,
  ------------------
  |  | 1023|      2|#define FALSE false
  ------------------
   73|      2|#endif
   74|      2|                           buf, sizeof(buf));
   75|      2|  if(result)
  ------------------
  |  Branch (75:6): [True: 0, False: 2]
  ------------------
   76|      0|    return result;
   77|       |
   78|     18|  for(i = 0; i < sizeof(buf); i++)
  ------------------
  |  Branch (78:14): [True: 16, False: 2]
  ------------------
   79|     16|    seed = (seed << 8) | buf[i];
   80|       |
   81|      2|  hash_seed = seed ? seed : 1;
  ------------------
  |  Branch (81:15): [True: 2, False: 0]
  ------------------
   82|       |  seeded = TRUE;
  ------------------
  |  | 1020|      2|#define TRUE true
  ------------------
   83|      2|  return CURLE_OK;
   84|      2|}
Curl_hash_init:
  217|    813|{
  218|    813|  DEBUGASSERT(h);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (218:3): [True: 0, False: 813]
  |  Branch (218:3): [True: 813, False: 0]
  ------------------
  219|    813|  DEBUGASSERT(slots);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (219:3): [True: 0, False: 813]
  |  Branch (219:3): [True: 813, False: 0]
  ------------------
  220|    813|  DEBUGASSERT((unsigned int)type < CURL_HASH_TYPE_LAST);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (220:3): [True: 0, False: 813]
  |  Branch (220:3): [True: 813, False: 0]
  ------------------
  221|    813|  DEBUGASSERT(dtor);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (221:3): [True: 0, False: 813]
  |  Branch (221:3): [True: 813, False: 0]
  ------------------
  222|       |
  223|    813|  h->table = NULL;
  224|    813|  h->dtor = dtor;
  225|    813|  h->size = 0;
  226|    813|  h->slots = slots;
  227|    813|  h->type = (uint8_t)type;
  228|    813|#ifdef DEBUGBUILD
  229|    813|  h->init = HASHINIT;
  ------------------
  |  |   33|    813|#define HASHINIT 0x7017e781
  ------------------
  230|    813|#endif
  231|    813|}
Curl_hash_destroy:
  410|    813|{
  411|    813|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (411:3): [True: 0, False: 813]
  |  Branch (411:3): [True: 813, False: 0]
  ------------------
  412|    813|  if(h->table) {
  ------------------
  |  Branch (412:6): [True: 0, False: 813]
  ------------------
  413|      0|    Curl_hash_clean(h);
  414|      0|    curlx_safefree(h->table);
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  415|      0|  }
  416|    813|  DEBUGASSERT(h->size == 0);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (416:3): [True: 0, False: 813]
  |  Branch (416:3): [True: 813, False: 0]
  ------------------
  417|    813|  h->slots = 0;
  418|    813|}

Curl_headers_cleanup:
  470|    813|{
  471|    813|  struct Curl_llist_node *e;
  472|    813|  struct Curl_llist_node *n;
  473|       |
  474|    813|  for(e = Curl_llist_head(&data->state.httphdrs); e; e = n) {
  ------------------
  |  Branch (474:51): [True: 0, False: 813]
  ------------------
  475|      0|    struct Curl_header_store *hs = Curl_node_elem(e);
  476|      0|    n = Curl_node_next(e);
  477|      0|    curlx_free(hs);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  478|      0|  }
  479|    813|  headers_reset(data);
  480|    813|  return CURLE_OK;
  481|    813|}
headers.c:headers_reset:
  403|    813|{
  404|       |  Curl_llist_init(&data->state.httphdrs, NULL);
  405|    813|  data->state.nh_count = 0;
  406|    813|}

Curl_hsts_cleanup:
   80|    813|{
   81|    813|  struct hsts *h = *hp;
   82|    813|  if(h) {
  ------------------
  |  Branch (82:6): [True: 0, False: 813]
  ------------------
   83|      0|    struct Curl_llist_node *e;
   84|      0|    struct Curl_llist_node *n;
   85|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (85:40): [True: 0, False: 0]
  ------------------
   86|      0|      struct stsentry *sts = Curl_node_elem(e);
   87|      0|      n = Curl_node_next(e);
   88|      0|      hsts_free(sts);
  ------------------
  |  |   77|      0|#define hsts_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
   89|      0|    }
   90|      0|    curlx_free(h->filename);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   91|      0|    curlx_free(h);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   92|       |    *hp = NULL;
   93|      0|  }
   94|    813|}
Curl_hsts_save:
  371|    813|{
  372|    813|  struct Curl_llist_node *e;
  373|    813|  struct Curl_llist_node *n;
  374|    813|  CURLcode result = CURLE_OK;
  375|    813|  FILE *out;
  376|    813|  char *tempstore = NULL;
  377|       |
  378|    813|  if(!h)
  ------------------
  |  Branch (378:6): [True: 813, False: 0]
  ------------------
  379|       |    /* no cache activated */
  380|    813|    return CURLE_OK;
  381|       |
  382|       |  /* if no new name is given, use the one we stored from the load */
  383|      0|  if(!file && h->filename)
  ------------------
  |  Branch (383:6): [True: 0, False: 0]
  |  Branch (383:15): [True: 0, False: 0]
  ------------------
  384|      0|    file = h->filename;
  385|       |
  386|      0|  if((h->flags & CURLHSTS_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1084|      0|#define CURLHSTS_READONLYFILE (1L << 1)
  ------------------
  |  Branch (386:6): [True: 0, False: 0]
  |  Branch (386:44): [True: 0, False: 0]
  |  Branch (386:53): [True: 0, False: 0]
  ------------------
  387|       |    /* marked as read-only, no file or zero length filename */
  388|      0|    goto skipsave;
  389|       |
  390|      0|  result = Curl_fopen(data, file, &out, &tempstore);
  391|      0|  if(!result) {
  ------------------
  |  Branch (391:6): [True: 0, False: 0]
  ------------------
  392|      0|    fputs("# Your HSTS cache. https://curl.se/docs/hsts.html\n"
  393|      0|          "# This file was generated by libcurl! Edit at your own risk.\n",
  394|      0|          out);
  395|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (395:40): [True: 0, False: 0]
  ------------------
  396|      0|      struct stsentry *sts = Curl_node_elem(e);
  397|      0|      n = Curl_node_next(e);
  398|      0|      hsts_out(sts, out);
  399|      0|    }
  400|      0|    curlx_fclose(out);
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  401|      0|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   74|      0|#define curlx_rename            rename
  ------------------
  |  Branch (401:8): [True: 0, False: 0]
  |  Branch (401:19): [True: 0, False: 0]
  |  Branch (401:32): [True: 0, False: 0]
  ------------------
  402|      0|      result = CURLE_WRITE_ERROR;
  403|       |
  404|      0|    if(result && tempstore)
  ------------------
  |  Branch (404:8): [True: 0, False: 0]
  |  Branch (404:18): [True: 0, False: 0]
  ------------------
  405|      0|      unlink(tempstore);
  406|      0|  }
  407|      0|  curlx_free(tempstore);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  408|      0|skipsave:
  409|      0|  if(data->set.hsts_write) {
  ------------------
  |  Branch (409:6): [True: 0, False: 0]
  ------------------
  410|       |    /* if there is a write callback */
  411|      0|    struct curl_index i; /* count */
  412|      0|    i.total = Curl_llist_count(&h->list);
  413|      0|    i.index = 0;
  414|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (414:40): [True: 0, False: 0]
  ------------------
  415|      0|      struct stsentry *sts = Curl_node_elem(e);
  416|      0|      bool stop;
  417|      0|      n = Curl_node_next(e);
  418|      0|      result = hsts_push(data, &i, sts, &stop);
  419|      0|      if(result || stop)
  ------------------
  |  Branch (419:10): [True: 0, False: 0]
  |  Branch (419:20): [True: 0, False: 0]
  ------------------
  420|      0|        break;
  421|      0|      i.index++;
  422|      0|    }
  423|      0|  }
  424|      0|  return result;
  425|      0|}

Curl_http_auth_cleanup_digest:
  184|    813|{
  185|    813|  Curl_auth_digest_cleanup(&data->state.digest);
  186|    813|  Curl_auth_digest_cleanup(&data->state.proxydigest);
  187|    813|}

Curl_llist_init:
   46|  1.62k|{
   47|  1.62k|  l->_size = 0;
   48|  1.62k|  l->_dtor = dtor;
   49|  1.62k|  l->_head = NULL;
   50|  1.62k|  l->_tail = NULL;
   51|  1.62k|#ifdef DEBUGBUILD
   52|  1.62k|  l->_init = LLISTINIT;
  ------------------
  |  |   29|  1.62k|#define LLISTINIT 0x100cc001 /* random pattern */
  ------------------
   53|  1.62k|#endif
   54|  1.62k|}
Curl_llist_head:
  207|    813|{
  208|    813|  DEBUGASSERT(list);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (208:3): [True: 0, False: 813]
  |  Branch (208:3): [True: 813, False: 0]
  ------------------
  209|    813|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [True: 0, False: 813]
  |  Branch (209:3): [True: 813, False: 0]
  ------------------
  210|    813|  return VERIFYNODE(list->_head);
  ------------------
  |  |   33|    813|#define VERIFYNODE(x) verifynode(x)
  ------------------
  211|    813|}
llist.c:verifynode:
   35|    813|{
   36|    813|  DEBUGASSERT(!n || (n->_init == NODEINIT));
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (36:3): [True: 813, False: 0]
  |  Branch (36:3): [True: 0, False: 0]
  |  Branch (36:3): [True: 813, False: 0]
  |  Branch (36:3): [True: 0, False: 0]
  ------------------
   37|    813|  return n;
   38|    813|}

curl_dbg_malloc:
  212|  6.47k|{
  213|  6.47k|  struct memdebug *mem;
  214|  6.47k|  size_t size;
  215|       |
  216|  6.47k|  DEBUGASSERT(wantedsize != 0);
  ------------------
  |  | 1050|  6.47k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (216:3): [True: 0, False: 6.47k]
  |  Branch (216:3): [True: 6.47k, False: 0]
  ------------------
  217|       |
  218|  6.47k|  if(countcheck("malloc", line, source))
  ------------------
  |  Branch (218:6): [True: 0, False: 6.47k]
  ------------------
  219|      0|    return NULL;
  220|       |
  221|       |  /* alloc at least 64 bytes */
  222|  6.47k|  size = sizeof(struct memdebug) + wantedsize;
  223|       |
  224|  6.47k|  mem = Curl_cmalloc(size);
  225|  6.47k|  if(mem) {
  ------------------
  |  Branch (225:6): [True: 6.47k, False: 0]
  ------------------
  226|  6.47k|    mem->size = wantedsize;
  227|  6.47k|  }
  228|       |
  229|  6.47k|  if(source)
  ------------------
  |  Branch (229:6): [True: 0, False: 6.47k]
  ------------------
  230|      0|    curl_dbg_log("MEM %s:%d malloc(%zu) = %p\n",
  231|      0|                 source, line, wantedsize,
  232|      0|                 mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (232:18): [True: 0, False: 0]
  ------------------
  233|       |
  234|  6.47k|  return mem ? mem->mem : NULL;
  ------------------
  |  Branch (234:10): [True: 6.47k, False: 0]
  ------------------
  235|  6.47k|}
curl_dbg_calloc:
  240|    899|{
  241|    899|  struct memdebug *mem;
  242|    899|  size_t size, user_size;
  243|       |
  244|    899|  DEBUGASSERT(wanted_elements != 0);
  ------------------
  |  | 1050|    899|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (244:3): [True: 0, False: 899]
  |  Branch (244:3): [True: 899, False: 0]
  ------------------
  245|    899|  DEBUGASSERT(wanted_size != 0);
  ------------------
  |  | 1050|    899|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (245:3): [True: 0, False: 899]
  |  Branch (245:3): [True: 899, False: 0]
  ------------------
  246|       |
  247|    899|  if(countcheck("calloc", line, source))
  ------------------
  |  Branch (247:6): [True: 0, False: 899]
  ------------------
  248|      0|    return NULL;
  249|       |
  250|       |  /* alloc at least 64 bytes */
  251|    899|  user_size = wanted_size * wanted_elements;
  252|    899|  size = sizeof(struct memdebug) + user_size;
  253|       |
  254|    899|  mem = Curl_ccalloc(1, size);
  255|    899|  if(mem)
  ------------------
  |  Branch (255:6): [True: 899, False: 0]
  ------------------
  256|    899|    mem->size = user_size;
  257|       |
  258|    899|  if(source)
  ------------------
  |  Branch (258:6): [True: 899, False: 0]
  ------------------
  259|    899|    curl_dbg_log("MEM %s:%d calloc(%zu,%zu) = %p\n",
  260|    899|                 source, line, wanted_elements, wanted_size,
  261|    899|                 mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (261:18): [True: 899, False: 0]
  ------------------
  262|       |
  263|    899|  return mem ? mem->mem : NULL;
  ------------------
  |  Branch (263:10): [True: 899, False: 0]
  ------------------
  264|    899|}
curl_dbg_strdup:
  268|  6.47k|{
  269|  6.47k|  char *mem;
  270|  6.47k|  size_t len;
  271|       |
  272|  6.47k|  DEBUGASSERT(str);
  ------------------
  |  | 1050|  6.47k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (272:3): [True: 0, False: 6.47k]
  |  Branch (272:3): [True: 6.47k, False: 0]
  ------------------
  273|       |
  274|  6.47k|  if(countcheck("strdup", line, source))
  ------------------
  |  Branch (274:6): [True: 0, False: 6.47k]
  ------------------
  275|      0|    return NULL;
  276|       |
  277|  6.47k|  len = strlen(str) + 1;
  278|       |
  279|  6.47k|  mem = curl_dbg_malloc(len, 0, NULL); /* NULL prevents logging */
  280|  6.47k|  if(mem)
  ------------------
  |  Branch (280:6): [True: 6.47k, False: 0]
  ------------------
  281|  6.47k|    memcpy(mem, str, len);
  282|       |
  283|  6.47k|  if(source)
  ------------------
  |  Branch (283:6): [True: 6.47k, False: 0]
  ------------------
  284|  6.47k|    curl_dbg_log("MEM %s:%d strdup(%p) (%zu) = %p\n",
  285|  6.47k|                 source, line, (const void *)str, len, (const void *)mem);
  286|       |
  287|  6.47k|  return mem;
  288|  6.47k|}
curl_dbg_realloc:
  321|  4.42k|{
  322|  4.42k|  struct memdebug *mem = NULL;
  323|  4.42k|  bool was_locked;
  324|       |
  325|  4.42k|  size_t size = sizeof(struct memdebug) + wantedsize;
  326|       |
  327|  4.42k|  DEBUGASSERT(wantedsize != 0);
  ------------------
  |  | 1050|  4.42k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (327:3): [True: 0, False: 4.42k]
  |  Branch (327:3): [True: 4.42k, False: 0]
  ------------------
  328|       |
  329|  4.42k|  if(countcheck("realloc", line, source))
  ------------------
  |  Branch (329:6): [True: 0, False: 4.42k]
  ------------------
  330|      0|    return NULL;
  331|       |
  332|       |  /* need to realloc under lock, as we get out-of-order log
  333|       |   * entries otherwise, since another thread might alloc the
  334|       |   * memory released by realloc() before otherwise would log it. */
  335|  4.42k|  was_locked = curl_dbg_lock();
  336|       |#ifdef __INTEL_COMPILER
  337|       |#  pragma warning(push)
  338|       |#  pragma warning(disable:1684)
  339|       |   /* 1684: conversion from pointer to same-sized integral type */
  340|       |#endif
  341|       |
  342|  4.42k|  if(ptr)
  ------------------
  |  Branch (342:6): [True: 2.36k, False: 2.05k]
  ------------------
  343|  2.36k|    mem = (void *)((char *)ptr - offsetof(struct memdebug, mem));
  344|       |
  345|       |#ifdef __INTEL_COMPILER
  346|       |#  pragma warning(pop)
  347|       |#endif
  348|       |
  349|  4.42k|  mem = Curl_crealloc(mem, size);
  350|  4.42k|  if(source)
  ------------------
  |  Branch (350:6): [True: 4.42k, False: 0]
  ------------------
  351|  4.42k|    curl_dbg_log_locked("MEM %s:%d realloc(%p, %zu) = %p\n",
  352|  4.42k|                        source, line, (void *)ptr, wantedsize,
  353|  4.42k|                        mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (353:25): [True: 4.42k, False: 0]
  ------------------
  354|       |
  355|  4.42k|  curl_dbg_unlock(was_locked);
  356|  4.42k|  if(mem) {
  ------------------
  |  Branch (356:6): [True: 4.42k, False: 0]
  ------------------
  357|  4.42k|    mem->size = wantedsize;
  358|  4.42k|    return mem->mem;
  359|  4.42k|  }
  360|       |
  361|      0|  return NULL;
  362|  4.42k|}
curl_dbg_free:
  365|  67.3k|{
  366|  67.3k|  if(ptr) {
  ------------------
  |  Branch (366:6): [True: 9.42k, False: 57.8k]
  ------------------
  367|  9.42k|    struct memdebug *mem;
  368|       |
  369|  9.42k|    if(source)
  ------------------
  |  Branch (369:8): [True: 9.42k, False: 0]
  ------------------
  370|  9.42k|      curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr);
  371|       |
  372|       |#ifdef __INTEL_COMPILER
  373|       |#  pragma warning(push)
  374|       |#  pragma warning(disable:1684)
  375|       |   /* 1684: conversion from pointer to same-sized integral type */
  376|       |#endif
  377|       |
  378|  9.42k|    mem = (void *)((char *)ptr - offsetof(struct memdebug, mem));
  379|       |
  380|       |#ifdef __INTEL_COMPILER
  381|       |#  pragma warning(pop)
  382|       |#endif
  383|       |
  384|       |    /* free for real */
  385|  9.42k|    Curl_cfree(mem);
  386|  9.42k|  }
  387|  67.3k|}
curl_dbg_fopen:
  477|    813|{
  478|    813|  FILE *res = CURLX_FOPEN_LOW(file, mode);
  ------------------
  |  |   68|    813|#define CURLX_FOPEN_LOW         fopen
  ------------------
  479|    813|  if(source)
  ------------------
  |  Branch (479:6): [True: 813, False: 0]
  ------------------
  480|    813|    curl_dbg_log("FILE %s:%d fopen(\"%s\",\"%s\") = %p\n",
  481|    813|                 source, line, file, mode, (void *)res);
  482|       |
  483|    813|  return res;
  484|    813|}
curl_dbg_fclose:
  510|    813|{
  511|    813|  int res;
  512|       |
  513|    813|  DEBUGASSERT(file);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (513:3): [True: 0, False: 813]
  |  Branch (513:3): [True: 813, False: 0]
  ------------------
  514|       |
  515|    813|  if(source)
  ------------------
  |  Branch (515:6): [True: 813, False: 0]
  ------------------
  516|    813|    curl_dbg_log("FILE %s:%d fclose(%p)\n", source, line, (void *)file);
  517|       |
  518|       |  /* !checksrc! disable BANNEDFUNC 1 */
  519|    813|  res = fclose(file);
  520|       |
  521|    813|  return res;
  522|    813|}
curl_dbg_log:
  565|  18.4k|{
  566|  18.4k|  bool was_locked;
  567|  18.4k|  va_list ap;
  568|       |
  569|  18.4k|  if(!curl_dbg_logfile)
  ------------------
  |  Branch (569:6): [True: 18.4k, False: 0]
  ------------------
  570|  18.4k|    return;
  571|       |
  572|      0|  was_locked = curl_dbg_lock();
  573|      0|  va_start(ap, format);
  574|      0|  curl_dbg_vlog(format, ap);
  575|       |  va_end(ap);
  576|      0|  curl_dbg_unlock(was_locked);
  577|      0|}
memdebug.c:countcheck:
  187|  18.2k|{
  188|       |  /* if source is NULL, then the call is made internally and this check
  189|       |     should not be made */
  190|  18.2k|  if(memlimit && source) {
  ------------------
  |  Branch (190:6): [True: 0, False: 18.2k]
  |  Branch (190:18): [True: 0, False: 0]
  ------------------
  191|      0|    if(!memsize) {
  ------------------
  |  Branch (191:8): [True: 0, False: 0]
  ------------------
  192|       |      /* log to file */
  193|      0|      curl_dbg_log("LIMIT %s:%d %s reached memlimit\n", source, line, func);
  194|       |      /* log to stderr also */
  195|      0|      curl_mfprintf(stderr, "LIMIT %s:%d %s reached memlimit\n",
  196|      0|                    source, line, func);
  197|      0|      dump_bt();
  198|      0|      fflush(curl_dbg_logfile); /* because it might crash now */
  199|       |      /* !checksrc! disable ERRNOVAR 1 */
  200|      0|      errno = ENOMEM;
  201|      0|      return TRUE; /* RETURN ERROR! */
  ------------------
  |  | 1020|      0|#define TRUE true
  ------------------
  202|      0|    }
  203|      0|    else
  204|      0|      memsize--; /* countdown */
  205|      0|  }
  206|       |
  207|  18.2k|  return FALSE; /* allow this */
  ------------------
  |  | 1023|  18.2k|#define FALSE false
  ------------------
  208|  18.2k|}
memdebug.c:curl_dbg_lock:
   74|  4.42k|{
   75|  4.42k|#ifdef USE_MUTEX
   76|  4.42k|  if(dbg_mutex_init) {
  ------------------
  |  Branch (76:6): [True: 0, False: 4.42k]
  ------------------
   77|      0|    Curl_mutex_acquire(&dbg_mutex);
  ------------------
  |  |   51|      0|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
   78|      0|    return TRUE;
  ------------------
  |  | 1020|      0|#define TRUE true
  ------------------
   79|      0|  }
   80|  4.42k|#endif
   81|  4.42k|  return FALSE;
  ------------------
  |  | 1023|  4.42k|#define FALSE false
  ------------------
   82|  4.42k|}
memdebug.c:curl_dbg_unlock:
   85|  4.42k|{
   86|  4.42k|#ifdef USE_MUTEX
   87|  4.42k|  if(was_locked)
  ------------------
  |  Branch (87:6): [True: 0, False: 4.42k]
  ------------------
   88|      0|    Curl_mutex_release(&dbg_mutex);
  ------------------
  |  |   52|      0|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
   89|       |#else
   90|       |  (void)was_locked;
   91|       |#endif
   92|  4.42k|}
memdebug.c:curl_dbg_log_locked:
  552|  4.42k|{
  553|  4.42k|  va_list ap;
  554|       |
  555|  4.42k|  if(!curl_dbg_logfile)
  ------------------
  |  Branch (555:6): [True: 4.42k, False: 0]
  ------------------
  556|  4.42k|    return;
  557|       |
  558|  4.42k|  va_start(ap, format);
  559|      0|  curl_dbg_vlog(format, ap);
  560|       |  va_end(ap);
  561|      0|}

Curl_mime_cleanpart:
 1080|  1.62k|{
 1081|  1.62k|  if(part) {
  ------------------
  |  Branch (1081:6): [True: 0, False: 1.62k]
  ------------------
 1082|      0|    cleanup_part_content(part);
 1083|      0|    curl_slist_free_all(part->curlheaders);
 1084|      0|    if(part->flags & MIME_USERHEADERS_OWNER)
  ------------------
  |  |   34|      0|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
  |  Branch (1084:8): [True: 0, False: 0]
  ------------------
 1085|      0|      curl_slist_free_all(part->userheaders);
 1086|      0|    curlx_safefree(part->mimetype);
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1087|      0|    curlx_safefree(part->name);
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1088|       |    curlx_safefree(part->filename);
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1089|      0|    Curl_mime_initpart(part);
 1090|      0|  }
 1091|  1.62k|}

Curl_detach_connection:
  917|    813|{
  918|    813|  struct connectdata *conn = data->conn;
  919|    813|  if(conn) {
  ------------------
  |  Branch (919:6): [True: 0, False: 813]
  ------------------
  920|       |    /* this should never happen, prevent underflow */
  921|      0|    DEBUGASSERT(conn->attached_xfers);
  ------------------
  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (921:5): [True: 0, False: 0]
  |  Branch (921:5): [True: 0, False: 0]
  ------------------
  922|      0|    if(conn->attached_xfers) {
  ------------------
  |  Branch (922:8): [True: 0, False: 0]
  ------------------
  923|      0|      conn->attached_xfers--;
  924|      0|      if(!conn->attached_xfers)
  ------------------
  |  Branch (924:10): [True: 0, False: 0]
  ------------------
  925|      0|        conn->attached_multi = NULL;
  926|      0|    }
  927|      0|  }
  928|    813|  data->conn = NULL;
  929|    813|}
Curl_expire_clear_all:
 3827|    813|{
 3828|    813|  struct Curl_multi *multi = data->multi;
 3829|       |
 3830|       |  /* this is only interesting while there is still an associated multi struct
 3831|       |     remaining! */
 3832|    813|  if(!multi)
  ------------------
  |  Branch (3832:6): [True: 813, False: 0]
  ------------------
 3833|    813|    return;
 3834|       |
 3835|      0|  if(Curl_timeouts_remove(&multi->timeouts, data)) {
  ------------------
  |  Branch (3835:6): [True: 0, False: 0]
  ------------------
 3836|       |    /* Since this is an cleared time, we must remove the previous entry from
 3837|       |       the splay tree */
 3838|      0|    multi_timeouts_init(data);
 3839|       |
 3840|      0|    if(data->id >= 0)
  ------------------
  |  Branch (3840:8): [True: 0, False: 0]
  ------------------
 3841|      0|      CURL_TRC_M(data, "[TIMEOUT] all cleared");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3842|      0|  }
 3843|      0|}

Curl_netrc_scan:
  585|    813|{
  586|    813|  NETRCcode retcode = NETRC_OK;
  587|       |
  588|    813|  CURL_TRC_M(data, "[NETRC] scanning '%s' for host '%s' user '%s'",
  ------------------
  |  |  148|    813|  do {                                   \
  |  |  149|    813|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|    813|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|    813|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  1.62k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 813, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 813]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  1.62k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|    813|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    813|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  589|    813|             netrcfile, hostname, user);
  590|    813|  Curl_creds_unlink(pcreds);
  591|    813|  if(!netrcfile) {
  ------------------
  |  Branch (591:6): [True: 0, False: 813]
  ------------------
  592|      0|    char *home = NULL;
  593|      0|    char *homea = NULL;
  594|      0|    char *filealloc = NULL;
  595|      0|#if defined(HAVE_GETPWUID_R) && defined(HAVE_GETEUID)
  596|      0|    char pwbuf[1024];
  597|      0|#endif
  598|      0|    filealloc = curl_getenv("NETRC");
  599|      0|    if(!filealloc) {
  ------------------
  |  Branch (599:8): [True: 0, False: 0]
  ------------------
  600|      0|      homea = curl_getenv("HOME"); /* portable environment reader */
  601|      0|      if(homea) {
  ------------------
  |  Branch (601:10): [True: 0, False: 0]
  ------------------
  602|      0|        home = homea;
  603|      0|#if defined(HAVE_GETPWUID_R) && defined(HAVE_GETEUID)
  604|      0|      }
  605|      0|      else {
  606|      0|        struct passwd pw, *pw_res;
  607|      0|        if(!getpwuid_r(geteuid(), &pw, pwbuf, sizeof(pwbuf), &pw_res) &&
  ------------------
  |  Branch (607:12): [True: 0, False: 0]
  ------------------
  608|      0|           pw_res) {
  ------------------
  |  Branch (608:12): [True: 0, False: 0]
  ------------------
  609|      0|          home = pw.pw_dir;
  610|      0|        }
  611|       |#elif defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
  612|       |      }
  613|       |      else {
  614|       |        struct passwd *pw;
  615|       |        pw = getpwuid(geteuid());
  616|       |        if(pw) {
  617|       |          home = pw->pw_dir;
  618|       |        }
  619|       |#elif defined(_WIN32)
  620|       |      }
  621|       |      else {
  622|       |        homea = curl_getenv("USERPROFILE");
  623|       |        if(homea) {
  624|       |          home = homea;
  625|       |        }
  626|       |#endif
  627|      0|      }
  628|       |
  629|      0|      if(!home)
  ------------------
  |  Branch (629:10): [True: 0, False: 0]
  ------------------
  630|      0|        return NETRC_FILE_MISSING; /* no home directory found (or possibly out
  631|       |                                      of memory) */
  632|       |
  633|      0|      filealloc = curl_maprintf("%s%s.netrc", home, DIR_CHAR);
  ------------------
  |  |  644|      0|#  define DIR_CHAR      "/"
  ------------------
  634|      0|      if(!filealloc) {
  ------------------
  |  Branch (634:10): [True: 0, False: 0]
  ------------------
  635|      0|        curlx_free(homea);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  636|      0|        retcode = NETRC_OUT_OF_MEMORY;
  637|      0|        goto out;
  638|      0|      }
  639|      0|    }
  640|      0|    retcode = netrc_scan_file(
  641|      0|      data, store, hostname, user, filealloc, pcreds);
  642|      0|    curlx_free(filealloc);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  643|       |#ifdef _WIN32
  644|       |    if(retcode == NETRC_FILE_MISSING) {
  645|       |      /* fallback to the old-style "_netrc" file */
  646|       |      filealloc = curl_maprintf("%s%s_netrc", home, DIR_CHAR);
  647|       |      if(!filealloc) {
  648|       |        curlx_free(homea);
  649|       |        return NETRC_OUT_OF_MEMORY;
  650|       |      }
  651|       |      retcode = netrc_scan_file(
  652|       |        data, store, hostname, user, filealloc, pcreds);
  653|       |      curlx_free(filealloc);
  654|       |    }
  655|       |#endif
  656|      0|    curlx_free(homea);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  657|      0|  }
  658|    813|  else
  659|    813|    retcode = netrc_scan_file(
  660|    813|      data, store, hostname, user, netrcfile, pcreds);
  661|       |
  662|    813|out:
  663|    813|  if(retcode)
  ------------------
  |  Branch (663:6): [True: 727, False: 86]
  ------------------
  664|    727|    Curl_creds_unlink(pcreds);
  665|    813|  return retcode;
  666|    813|}
Curl_netrc_init:
  669|  1.62k|{
  670|  1.62k|  curlx_dyn_init(&store->filebuf, MAX_NETRC_FILE);
  ------------------
  |  |   77|  1.62k|#define MAX_NETRC_FILE  (128 * 1024)
  ------------------
  671|  1.62k|  store->loaded = FALSE;
  ------------------
  |  | 1023|  1.62k|#define FALSE false
  ------------------
  672|       |  store->filename = NULL;
  673|  1.62k|}
Curl_netrc_cleanup:
  675|  1.62k|{
  676|  1.62k|  curlx_dyn_free(&store->filebuf);
  677|  1.62k|  curlx_safefree(store->filename);
  ------------------
  |  | 1371|  1.62k|  do {                      \
  |  | 1372|  1.62k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  1.62k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  1.62k|    (ptr) = NULL;           \
  |  | 1374|  1.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
  678|       |  store->loaded = FALSE;
  ------------------
  |  | 1023|  1.62k|#define FALSE false
  ------------------
  679|  1.62k|}
Curl_netrc_strerror:
  682|    818|{
  683|    818|  switch(ret) {
  684|     87|  default:
  ------------------
  |  Branch (684:3): [True: 87, False: 731]
  ------------------
  685|     87|    return ""; /* not a legit error */
  686|      1|  case NETRC_FILE_MISSING:
  ------------------
  |  Branch (686:3): [True: 1, False: 817]
  ------------------
  687|      1|    return "no such file";
  688|    560|  case NETRC_NO_MATCH:
  ------------------
  |  Branch (688:3): [True: 560, False: 258]
  ------------------
  689|    560|    return "no matching entry";
  690|      1|  case NETRC_OUT_OF_MEMORY:
  ------------------
  |  Branch (690:3): [True: 1, False: 817]
  ------------------
  691|      1|    return "out of memory";
  692|    169|  case NETRC_SYNTAX_ERROR:
  ------------------
  |  Branch (692:3): [True: 169, False: 649]
  ------------------
  693|    169|    return "syntax error";
  694|    818|  }
  695|       |  /* never reached */
  696|    818|}
netrc.c:netrc_scan_file:
  548|    813|{
  549|    813|  struct dynbuf *filebuf = &store->filebuf;
  550|       |
  551|    813|  if(!store->loaded || strcmp(netrcfile, store->filename)) {
  ------------------
  |  Branch (551:6): [True: 813, False: 0]
  |  Branch (551:24): [True: 0, False: 0]
  ------------------
  552|    813|    NETRCcode ret;
  553|    813|    store->loaded = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  554|    813|    ret = file2memory(netrcfile, filebuf);
  555|    813|    if(ret) {
  ------------------
  |  Branch (555:8): [True: 6, False: 807]
  ------------------
  556|      6|      CURL_TRC_M(data, "[NETRC] could not load '%s'", netrcfile);
  ------------------
  |  |  148|      6|  do {                                   \
  |  |  149|      6|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      6|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      6|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|     12|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 6, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|     12|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      6|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      6|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      6|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 6]
  |  |  ------------------
  ------------------
  557|      6|      return ret;
  558|      6|    }
  559|    807|    curlx_free(store->filename);
  ------------------
  |  | 1515|    807|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  560|    807|    store->filename = curlx_strdup(netrcfile);
  ------------------
  |  | 1509|    807|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  561|    807|    if(!store->filename) {
  ------------------
  |  Branch (561:8): [True: 0, False: 807]
  ------------------
  562|      0|      curlx_dyn_reset(&store->filebuf);
  563|      0|      return NETRC_OUT_OF_MEMORY;
  564|      0|    }
  565|    807|    store->loaded = TRUE;
  ------------------
  |  | 1020|    807|#define TRUE true
  ------------------
  566|    807|  }
  567|    807|  if(!curlx_dyn_len(filebuf))
  ------------------
  |  Branch (567:6): [True: 0, False: 807]
  ------------------
  568|      0|    return NETRC_NO_MATCH;
  569|       |
  570|    807|  return netrc_scan(data, curlx_dyn_ptr(filebuf), hostname, user, pcreds);
  571|    807|}
netrc.c:file2memory:
  504|    813|{
  505|    813|  NETRCcode ret = NETRC_FILE_MISSING; /* if it cannot open the file */
  506|    813|  FILE *file = curlx_fopen(filename, FOPEN_READTEXT);
  ------------------
  |  |   83|    813|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  507|       |
  508|    813|  curlx_dyn_reset(filebuf);
  509|    813|  if(file) {
  ------------------
  |  Branch (509:6): [True: 813, False: 0]
  ------------------
  510|    813|    curlx_struct_stat stat;
  ------------------
  |  |   67|    813|#define curlx_struct_stat       struct stat
  ------------------
  511|    813|    if((curlx_fstat(fileno(file), &stat) == -1) || !S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   66|    813|#define curlx_fstat             fstat
  ------------------
  |  Branch (511:8): [True: 0, False: 813]
  |  Branch (511:52): [True: 813, False: 0]
  ------------------
  512|    813|      CURLcode result = CURLE_OK;
  513|    813|      bool eof;
  514|    813|      struct dynbuf linebuf;
  515|    813|      curlx_dyn_init(&linebuf, MAX_NETRC_LINE);
  ------------------
  |  |   76|    813|#define MAX_NETRC_LINE  16384
  ------------------
  516|    813|      ret = NETRC_OK;
  517|  68.6k|      do {
  518|  68.6k|        const char *line;
  519|       |        /* Curl_get_line always returns lines ending with a newline */
  520|  68.6k|        result = Curl_get_line(&linebuf, file, &eof);
  521|  68.6k|        if(!result) {
  ------------------
  |  Branch (521:12): [True: 68.6k, False: 4]
  ------------------
  522|  68.6k|          line = curlx_dyn_ptr(&linebuf);
  523|       |          /* skip comments on load */
  524|  68.6k|          curlx_str_passblanks(&line);
  525|  68.6k|          if(*line == '#')
  ------------------
  |  Branch (525:14): [True: 194, False: 68.4k]
  ------------------
  526|    194|            continue;
  527|  68.4k|          result = curlx_dyn_add(filebuf, line);
  528|  68.4k|        }
  529|  68.4k|        if(result) {
  ------------------
  |  Branch (529:12): [True: 6, False: 68.4k]
  ------------------
  530|      6|          curlx_dyn_free(filebuf);
  531|      6|          ret = curl2netrc(result);
  ------------------
  |  |   84|      6|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 0, False: 6]
  |  |  |  Branch (84:25): [True: 0, False: 6]
  |  |  ------------------
  |  |   85|      6|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  532|      6|          break;
  533|      6|        }
  534|  68.6k|      } while(!eof);
  ------------------
  |  Branch (534:15): [True: 67.8k, False: 807]
  ------------------
  535|    813|      curlx_dyn_free(&linebuf);
  536|    813|    }
  537|    813|    curlx_fclose(file);
  ------------------
  |  |   88|    813|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  538|    813|  }
  539|    813|  return ret;
  540|    813|}
netrc.c:netrc_scan:
  428|    807|{
  429|    807|  struct netrc_scanner sc;
  430|    807|  NETRCcode rc = NETRC_OK;
  431|       |
  432|    807|  Curl_creds_unlink(pcreds);
  433|    807|  netrc_scan_init(&sc, data, content, hostname, user);
  434|       |
  435|  21.2k|  while(!rc && !sc.found) {
  ------------------
  |  Branch (435:9): [True: 21.0k, False: 162]
  |  Branch (435:16): [True: 21.0k, False: 0]
  ------------------
  436|  21.0k|    rc = netrc_lexer_next(&sc.lexer, FALSE);
  ------------------
  |  | 1023|  21.0k|#define FALSE false
  ------------------
  437|  21.0k|    if(!rc) {
  ------------------
  |  Branch (437:8): [True: 20.9k, False: 138]
  ------------------
  438|       |      /* Does this token end any previous entry? */
  439|  20.9k|      switch(sc.lexer.token) {
  440|    636|      case NETRC_TOK_EOF:
  ------------------
  |  Branch (440:7): [True: 636, False: 20.2k]
  ------------------
  441|  1.22k|      case NETRC_TOK_MACHINE:
  ------------------
  |  Branch (441:7): [True: 584, False: 20.3k]
  ------------------
  442|  5.21k|      case NETRC_TOK_DEFAULT:
  ------------------
  |  Branch (442:7): [True: 3.99k, False: 16.9k]
  ------------------
  443|  5.98k|      case NETRC_TOK_MACDEF:
  ------------------
  |  Branch (443:7): [True: 777, False: 20.1k]
  ------------------
  444|  5.98k|        rc = netrc_scan_end_entry(&sc);
  445|  5.98k|        if(rc || sc.found)
  ------------------
  |  Branch (445:12): [True: 0, False: 5.98k]
  |  Branch (445:18): [True: 86, False: 5.90k]
  ------------------
  446|     86|          goto out;
  447|  5.90k|        break;
  448|  14.9k|      default:
  ------------------
  |  Branch (448:7): [True: 14.9k, False: 5.98k]
  ------------------
  449|  14.9k|        break;
  450|  20.9k|      }
  451|       |
  452|  20.8k|      switch(sc.lexer.token) {
  453|    559|      case NETRC_TOK_EOF:
  ------------------
  |  Branch (453:7): [True: 559, False: 20.2k]
  ------------------
  454|    559|        goto out;
  455|    584|      case NETRC_TOK_MACHINE:
  ------------------
  |  Branch (455:7): [True: 584, False: 20.2k]
  ------------------
  456|    584|        rc = netrc_lexer_next(&sc.lexer, TRUE);
  ------------------
  |  | 1020|    584|#define TRUE true
  ------------------
  457|    584|        if(!rc) {
  ------------------
  |  Branch (457:12): [True: 583, False: 1]
  ------------------
  458|    583|          if(sc.lexer.token == NETRC_TOK_LITERAL) {
  ------------------
  |  Branch (458:14): [True: 578, False: 5]
  ------------------
  459|    578|            sc.matches_host = curl_strequal(
  460|    578|              sc.hostname, curlx_dyn_ptr(&sc.lexer.literal));
  461|    578|          }
  462|      5|          else {
  463|      5|            sc.matches_host = FALSE;
  ------------------
  |  | 1023|      5|#define FALSE false
  ------------------
  464|      5|            netrc_lexer_push(&sc.lexer);
  465|      5|          }
  466|    583|        }
  467|    584|        break;
  468|  3.98k|      case NETRC_TOK_DEFAULT:
  ------------------
  |  Branch (468:7): [True: 3.98k, False: 16.8k]
  ------------------
  469|  3.98k|        sc.matches_host = TRUE;
  ------------------
  |  | 1020|  3.98k|#define TRUE true
  ------------------
  470|  3.98k|        break;
  471|    272|      case NETRC_TOK_ACCOUNT:
  ------------------
  |  Branch (471:7): [True: 272, False: 20.5k]
  ------------------
  472|    272|        rc = netrc_scan_literal(&sc, NULL); /* ignore, not used */
  473|    272|        break;
  474|  4.63k|      case NETRC_TOK_LOGIN:
  ------------------
  |  Branch (474:7): [True: 4.63k, False: 16.1k]
  ------------------
  475|  4.63k|        rc = netrc_scan_literal(&sc, &sc.login);
  476|  4.63k|        break;
  477|  1.84k|      case NETRC_TOK_PASSWD:
  ------------------
  |  Branch (477:7): [True: 1.84k, False: 18.9k]
  ------------------
  478|  1.84k|        rc = netrc_scan_literal(&sc, &sc.passwd);
  479|  1.84k|        break;
  480|    777|      case NETRC_TOK_MACDEF:
  ------------------
  |  Branch (480:7): [True: 777, False: 20.0k]
  ------------------
  481|    777|        netrc_skip_to_empty_line(&sc.lexer);
  482|    777|        break;
  483|    637|      case NETRC_TOK_LITERAL:
  ------------------
  |  Branch (483:7): [True: 637, False: 20.1k]
  ------------------
  484|  8.16k|      case NETRC_TOK_JUNK:
  ------------------
  |  Branch (484:7): [True: 7.52k, False: 13.2k]
  ------------------
  485|  8.16k|      default:
  ------------------
  |  Branch (485:7): [True: 0, False: 20.8k]
  ------------------
  486|       |        /* skip this */
  487|  8.16k|        break;
  488|  20.8k|      }
  489|  20.8k|    }
  490|  21.0k|  }
  491|       |
  492|    807|out:
  493|    807|  if(!rc) {
  ------------------
  |  Branch (493:6): [True: 645, False: 162]
  ------------------
  494|    645|    if(sc.creds)
  ------------------
  |  Branch (494:8): [True: 86, False: 559]
  ------------------
  495|     86|      Curl_creds_link(pcreds, sc.creds);
  496|    559|    else
  497|    559|      rc = NETRC_NO_MATCH;
  498|    645|  }
  499|    807|  netrc_scan_cleanup(&sc);
  500|    807|  return rc;
  501|    807|}
netrc.c:netrc_scan_init:
  345|    807|{
  346|    807|  memset(sc, 0, sizeof(*sc));
  347|    807|  netrc_lexer_init(&sc->lexer, data, content);
  348|    807|  sc->hostname = hostname;
  349|    807|  sc->user = (user && user[0]) ? user : NULL;
  ------------------
  |  Branch (349:15): [True: 351, False: 456]
  |  Branch (349:23): [True: 351, False: 0]
  ------------------
  350|    807|  netrc_scan_reset(sc);
  351|    807|}
netrc.c:netrc_lexer_init:
  139|    807|{
  140|    807|  curlx_dyn_init(&lexer->literal, MAX_NETRC_TOKEN);
  ------------------
  |  |   78|    807|#define MAX_NETRC_TOKEN 4096
  ------------------
  141|    807|  lexer->data = data;
  142|    807|  lexer->content = lexer->pos = content;
  143|    807|}
netrc.c:netrc_scan_reset:
  334|  7.60k|{
  335|  7.60k|  curlx_safefree(sc->login);
  ------------------
  |  | 1371|  7.60k|  do {                      \
  |  | 1372|  7.60k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  7.60k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  7.60k|    (ptr) = NULL;           \
  |  | 1374|  7.60k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 7.60k]
  |  |  ------------------
  ------------------
  336|  7.60k|  curlx_safefree(sc->passwd);
  ------------------
  |  | 1371|  7.60k|  do {                      \
  |  | 1372|  7.60k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  7.60k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  7.60k|    (ptr) = NULL;           \
  |  | 1374|  7.60k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 7.60k]
  |  |  ------------------
  ------------------
  337|       |  sc->matches_host = FALSE;
  ------------------
  |  | 1023|  7.60k|#define FALSE false
  ------------------
  338|  7.60k|}
netrc.c:netrc_lexer_next:
  250|  28.3k|{
  251|  28.3k|  const char *s = lexer->pos, *start;
  252|  28.3k|  NETRCcode rc = NETRC_OK;
  253|  28.3k|  size_t slen;
  254|  28.3k|  CURLcode result;
  255|       |
  256|  28.3k|  if(lexer->pushed) {
  ------------------
  |  Branch (256:6): [True: 26, False: 28.3k]
  ------------------
  257|     26|    lexer->pushed = FALSE;
  ------------------
  |  | 1023|     26|#define FALSE false
  ------------------
  258|     26|    goto out;
  259|     26|  }
  260|       |
  261|  28.3k|  curlx_dyn_reset(&lexer->literal);
  262|  28.3k|  netrc_skip_blanks(lexer);
  263|  28.3k|  s = lexer->pos;
  264|       |
  265|  28.3k|  switch(*s) {
  266|    636|  case 0:
  ------------------
  |  Branch (266:3): [True: 636, False: 27.7k]
  ------------------
  267|    636|    lexer->token = NETRC_TOK_EOF;
  268|    636|    break;
  269|    768|  case '\"':
  ------------------
  |  Branch (269:3): [True: 768, False: 27.5k]
  ------------------
  270|    768|    rc = netrc_lexer_quoted(lexer);
  271|    768|    lexer->token = NETRC_TOK_LITERAL;
  272|    768|    s = lexer->pos;
  273|    768|    break;
  274|  26.9k|  default:
  ------------------
  |  Branch (274:3): [True: 26.9k, False: 1.40k]
  ------------------
  275|       |    /* unquoted token */
  276|  26.9k|    start = s;
  277|   858k|    while(*s && !ISBLANK(*s) && !ISNEWLINE(*s))
  ------------------
  |  |   43|  1.71M|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 15.6k, False: 842k]
  |  |  |  Branch (43:38): [True: 724, False: 842k]
  |  |  ------------------
  ------------------
                  while(*s && !ISBLANK(*s) && !ISNEWLINE(*s))
  ------------------
  |  |   48|   842k|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (48:26): [True: 6.75k, False: 835k]
  |  |  |  Branch (48:43): [True: 3.77k, False: 831k]
  |  |  ------------------
  ------------------
  |  Branch (277:11): [True: 858k, False: 0]
  ------------------
  278|   831k|      ++s;
  279|  26.9k|    slen = s - start;
  280|  26.9k|    if(!slen) {
  ------------------
  |  Branch (280:8): [True: 3.19k, False: 23.7k]
  ------------------
  281|  3.19k|      rc = NETRC_SYNTAX_ERROR;
  282|  3.19k|    }
  283|  26.9k|    if(want_literal) {
  ------------------
  |  Branch (283:8): [True: 7.29k, False: 19.6k]
  ------------------
  284|  7.29k|      lexer->token = NETRC_TOK_LITERAL;
  285|  7.29k|      result = curlx_dyn_addn(&lexer->literal, start, slen);
  286|  7.29k|      rc = curl2netrc(result);
  ------------------
  |  |   84|  7.29k|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 7.28k, False: 16]
  |  |  |  Branch (84:25): [True: 0, False: 16]
  |  |  ------------------
  |  |   85|     16|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  287|  7.29k|    }
  288|  19.6k|    else if((slen == 7) && curl_strnequal(start, "machine", slen)) {
  ------------------
  |  Branch (288:13): [True: 6.60k, False: 13.0k]
  |  Branch (288:28): [True: 584, False: 6.02k]
  ------------------
  289|    584|      lexer->token = NETRC_TOK_MACHINE;
  290|    584|    }
  291|  19.0k|    else if((slen == 7) && curl_strnequal(start, "default", slen)) {
  ------------------
  |  Branch (291:13): [True: 6.02k, False: 13.0k]
  |  Branch (291:28): [True: 3.99k, False: 2.03k]
  ------------------
  292|  3.99k|      lexer->token = NETRC_TOK_DEFAULT;
  293|  3.99k|    }
  294|  15.0k|    else if((slen == 7) && curl_strnequal(start, "account", slen)) {
  ------------------
  |  Branch (294:13): [True: 2.03k, False: 13.0k]
  |  Branch (294:28): [True: 272, False: 1.76k]
  ------------------
  295|    272|      lexer->token = NETRC_TOK_ACCOUNT;
  296|    272|    }
  297|  14.7k|    else if((slen == 5) && curl_strnequal(start, "login", slen)) {
  ------------------
  |  Branch (297:13): [True: 4.92k, False: 9.87k]
  |  Branch (297:28): [True: 4.63k, False: 294]
  ------------------
  298|  4.63k|      lexer->token = NETRC_TOK_LOGIN;
  299|  4.63k|    }
  300|  10.1k|    else if((slen == 8) && curl_strnequal(start, "password", slen)) {
  ------------------
  |  Branch (300:13): [True: 2.13k, False: 8.02k]
  |  Branch (300:28): [True: 1.84k, False: 294]
  ------------------
  301|  1.84k|      lexer->token = NETRC_TOK_PASSWD;
  302|  1.84k|    }
  303|  8.32k|    else if((slen == 6) && curl_strnequal(start, "macdef", slen)) {
  ------------------
  |  Branch (303:13): [True: 1.19k, False: 7.12k]
  |  Branch (303:28): [True: 777, False: 417]
  ------------------
  304|    777|      lexer->token = NETRC_TOK_MACDEF;
  305|    777|    }
  306|  7.54k|    else {
  307|  7.54k|      lexer->token = NETRC_TOK_JUNK;
  308|  7.54k|    }
  309|  26.9k|    break;
  310|  28.3k|  }
  311|       |
  312|  28.3k|out:
  313|       |#if NETRC_DEBUG
  314|       |  CURL_TRC_M(lexer->data, "[NETRC] token %s '%s', rc=%d",
  315|       |             netrc_tokenstr(lexer->token),
  316|       |             curlx_dyn_ptr(&lexer->literal), rc);
  317|       |#endif
  318|  28.3k|  lexer->pos = s;
  319|  28.3k|  return rc;
  320|  28.3k|}
netrc.c:netrc_skip_blanks:
  153|  28.3k|{
  154|  28.3k|  const char *s = lexer->pos;
  155|  42.7k|  while(*s) {
  ------------------
  |  Branch (155:9): [True: 42.1k, False: 636]
  ------------------
  156|  42.1k|    curlx_str_passblanks(&s);
  157|  46.8k|    while(*s == '\r')
  ------------------
  |  Branch (157:11): [True: 4.64k, False: 42.1k]
  ------------------
  158|  4.64k|      ++s;
  159|  42.1k|    if(*s == '\n') {
  ------------------
  |  Branch (159:8): [True: 14.4k, False: 27.7k]
  ------------------
  160|  14.4k|      ++s;
  161|  14.4k|    }
  162|  27.7k|    else
  163|  27.7k|      break;
  164|  42.1k|  }
  165|  28.3k|  lexer->pos = s;
  166|  28.3k|}
netrc.c:netrc_lexer_quoted:
  195|    768|{
  196|    768|  NETRCcode rc = NETRC_SYNTAX_ERROR;
  197|    768|  const char *s = lexer->pos;
  198|    768|  bool escape = FALSE;
  ------------------
  |  | 1023|    768|#define FALSE false
  ------------------
  199|    768|  CURLcode result;
  200|       |
  201|    768|  DEBUGASSERT(*s == '\"');
  ------------------
  |  | 1050|    768|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 768]
  |  Branch (201:3): [True: 768, False: 0]
  ------------------
  202|    768|  ++s; /* pass the leading quote */
  203|   144k|  while(*s) {
  ------------------
  |  Branch (203:9): [True: 144k, False: 122]
  ------------------
  204|   144k|    char c = *s;
  205|   144k|    if(escape) {
  ------------------
  |  Branch (205:8): [True: 1.12k, False: 143k]
  ------------------
  206|  1.12k|      escape = FALSE;
  ------------------
  |  | 1023|  1.12k|#define FALSE false
  ------------------
  207|  1.12k|      switch(c) {
  ------------------
  |  Branch (207:14): [True: 802, False: 319]
  ------------------
  208|    212|      case 'n':
  ------------------
  |  Branch (208:7): [True: 212, False: 909]
  ------------------
  209|    212|        c = '\n';
  210|    212|        break;
  211|    253|      case 'r':
  ------------------
  |  Branch (211:7): [True: 253, False: 868]
  ------------------
  212|    253|        c = '\r';
  213|    253|        break;
  214|    337|      case 't':
  ------------------
  |  Branch (214:7): [True: 337, False: 784]
  ------------------
  215|    337|        c = '\t';
  216|    337|        break;
  217|  1.12k|      }
  218|  1.12k|    }
  219|   143k|    else if(c == '\\') {
  ------------------
  |  Branch (219:13): [True: 1.12k, False: 142k]
  ------------------
  220|  1.12k|      escape = TRUE;
  ------------------
  |  | 1020|  1.12k|#define TRUE true
  ------------------
  221|  1.12k|      ++s;
  222|  1.12k|      continue;
  223|  1.12k|    }
  224|   142k|    else if(c == '\"') {
  ------------------
  |  Branch (224:13): [True: 638, False: 141k]
  ------------------
  225|    638|      ++s; /* pass the ending quote */
  226|       |      /* Ensure even an empty literal has a null-terminator. */
  227|    638|      result = curlx_dyn_addn(&lexer->literal, "", 0);
  228|    638|      rc = curl2netrc(result);
  ------------------
  |  |   84|    638|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 638, False: 0]
  |  |  |  Branch (84:25): [True: 0, False: 0]
  |  |  ------------------
  |  |   85|      0|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  229|    638|      goto out;
  230|    638|    }
  231|   142k|    result = curlx_dyn_addn(&lexer->literal, &c, 1);
  232|   142k|    if(result) {
  ------------------
  |  Branch (232:8): [True: 8, False: 142k]
  ------------------
  233|      8|      rc = curl2netrc(result);
  ------------------
  |  |   84|      8|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 0, False: 8]
  |  |  |  Branch (84:25): [True: 0, False: 8]
  |  |  ------------------
  |  |   85|      8|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  234|      8|      goto out;
  235|      8|    }
  236|   142k|    ++s;
  237|   142k|  }
  238|    768|out:
  239|    768|  lexer->pos = s;
  240|    768|  return rc;
  241|    768|}
netrc.c:netrc_scan_end_entry:
  382|  5.98k|{
  383|  5.98k|  NETRCcode rc = NETRC_OK;
  384|       |#if NETRC_DEBUG
  385|       |  CURL_TRC_M(sc->lexer.data,
  386|       |             "[NETRC] entry matches_host=%d, login='%s', passwd='%s'",
  387|       |             sc->matches_host, sc->login, sc->passwd);
  388|       |#endif
  389|  5.98k|  if(sc->matches_host) {
  ------------------
  |  Branch (389:6): [True: 4.23k, False: 1.75k]
  ------------------
  390|  4.23k|    if(sc->login) {
  ------------------
  |  Branch (390:8): [True: 2.23k, False: 2.00k]
  ------------------
  391|  2.23k|      if(sc->user) {
  ------------------
  |  Branch (391:10): [True: 2.18k, False: 51]
  ------------------
  392|  2.18k|        if(Curl_timestrcmp(sc->user, sc->login))
  ------------------
  |  Branch (392:12): [True: 1.75k, False: 421]
  ------------------
  393|  1.75k|          goto out;
  394|       |        /* We look for a specific user,
  395|       |         * entry is only interesting with password */
  396|    421|        sc->found = !!sc->passwd;
  397|    421|      }
  398|     51|      else {
  399|     51|        sc->found = TRUE;
  ------------------
  |  | 1020|     51|#define TRUE true
  ------------------
  400|     51|      }
  401|  2.23k|    }
  402|  2.00k|    else if(sc->passwd) {
  ------------------
  |  Branch (402:13): [True: 35, False: 1.96k]
  ------------------
  403|       |      /* found a passwd that applies to any user */
  404|     35|      sc->found = TRUE;
  ------------------
  |  | 1020|     35|#define TRUE true
  ------------------
  405|     35|    }
  406|  1.96k|    else {
  407|       |      /* entry has nothing interesting */
  408|  1.96k|    }
  409|  2.47k|    if(sc->found) {
  ------------------
  |  Branch (409:8): [True: 86, False: 2.38k]
  ------------------
  410|       |#if NETRC_DEBUG
  411|       |      CURL_TRC_M(sc->lexer.data, "[NETRC] entry match found");
  412|       |#endif
  413|     86|      if(Curl_creds_create(sc->user ? sc->user : sc->login, sc->passwd,
  ------------------
  |  Branch (413:10): [True: 0, False: 86]
  |  Branch (413:28): [True: 26, False: 60]
  ------------------
  414|     86|                           NULL, NULL, NULL, CREDS_NETRC, &sc->creds))
  ------------------
  |  |   32|     86|#define CREDS_NETRC  3 /* username/passwd found in netrc */
  ------------------
  415|      0|        rc = NETRC_OUT_OF_MEMORY;
  416|     86|    }
  417|  2.47k|  }
  418|  5.98k|out:
  419|  5.98k|  netrc_scan_reset(sc);
  420|  5.98k|  return rc;
  421|  5.98k|}
netrc.c:netrc_lexer_push:
  244|     26|{
  245|       |  lexer->pushed = TRUE;
  ------------------
  |  | 1020|     26|#define TRUE true
  ------------------
  246|     26|}
netrc.c:netrc_scan_literal:
  364|  6.74k|{
  365|  6.74k|  NETRCcode rc = netrc_lexer_next(&sc->lexer, TRUE);
  ------------------
  |  | 1020|  6.74k|#define TRUE true
  ------------------
  366|  6.74k|  if(!rc) {
  ------------------
  |  Branch (366:6): [True: 6.72k, False: 23]
  ------------------
  367|  6.72k|    if(sc->lexer.token == NETRC_TOK_LITERAL) {
  ------------------
  |  Branch (367:8): [True: 6.70k, False: 21]
  ------------------
  368|  6.70k|      if(pdest && sc->matches_host) {
  ------------------
  |  Branch (368:10): [True: 6.44k, False: 263]
  |  Branch (368:19): [True: 5.66k, False: 778]
  ------------------
  369|  5.66k|        curlx_free(*pdest);
  ------------------
  |  | 1515|  5.66k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  370|  5.66k|        *pdest = curlx_strdup(curlx_dyn_ptr(&sc->lexer.literal));
  ------------------
  |  | 1509|  5.66k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  371|  5.66k|        if(!*pdest)
  ------------------
  |  Branch (371:12): [True: 0, False: 5.66k]
  ------------------
  372|      0|          rc = NETRC_OUT_OF_MEMORY;
  373|  5.66k|      }
  374|  6.70k|    }
  375|     21|    else
  376|     21|      netrc_lexer_push(&sc->lexer);
  377|  6.72k|  }
  378|  6.74k|  return rc;
  379|  6.74k|}
netrc.c:netrc_skip_to_empty_line:
  169|    777|{
  170|    777|  const char *s = lexer->pos;
  171|  4.89k|  while(*s) {
  ------------------
  |  Branch (171:9): [True: 4.84k, False: 54]
  ------------------
  172|  4.84k|    if(*s == '\r')
  ------------------
  |  Branch (172:8): [True: 602, False: 4.23k]
  ------------------
  173|    602|      ++s;
  174|  4.23k|    else if(*s == '\n') {
  ------------------
  |  Branch (174:13): [True: 989, False: 3.24k]
  ------------------
  175|    989|      ++s;
  176|  1.18k|      while(*s == '\r')
  ------------------
  |  Branch (176:13): [True: 195, False: 989]
  ------------------
  177|    195|        ++s;
  178|    989|      if(*s == '\n')
  ------------------
  |  Branch (178:10): [True: 723, False: 266]
  ------------------
  179|    723|        goto out;
  180|    989|    }
  181|  3.24k|    else
  182|  3.24k|      ++s;
  183|  4.84k|  }
  184|    777|out:
  185|    777|  lexer->pos = s;
  186|    777|}
netrc.c:netrc_scan_cleanup:
  354|    807|{
  355|    807|  netrc_scan_reset(sc);
  356|    807|  sc->hostname = NULL;
  357|       |  sc->user = NULL;
  358|    807|  Curl_creds_unlink(&sc->creds);
  359|    807|  netrc_lexer_cleanup(&sc->lexer);
  360|    807|}
netrc.c:netrc_lexer_cleanup:
  146|    807|{
  147|    807|  lexer->content = lexer->pos = NULL;
  148|       |  lexer->data = NULL;
  149|    807|  curlx_dyn_free(&lexer->literal);
  150|    807|}

Curl_peer_unlink:
  307|  4.06k|{
  308|  4.06k|  if(*ppeer) {
  ------------------
  |  Branch (308:6): [True: 0, False: 4.06k]
  ------------------
  309|      0|    struct Curl_peer *peer = *ppeer;
  310|       |
  311|      0|    DEBUGASSERT(peer->refcount);
  ------------------
  |  | 1050|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (311:5): [True: 0, False: 0]
  |  Branch (311:5): [True: 0, False: 0]
  ------------------
  312|      0|    *ppeer = NULL;
  313|      0|    if(peer->refcount)
  ------------------
  |  Branch (313:8): [True: 0, False: 0]
  ------------------
  314|      0|      peer->refcount--;
  315|      0|    if(!peer->refcount) {
  ------------------
  |  Branch (315:8): [True: 0, False: 0]
  ------------------
  316|      0|      curlx_free(peer);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  317|      0|    }
  318|      0|  }
  319|  4.06k|}

Curl_rand_bytes:
  144|      2|{
  145|      2|  CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT;
  146|       |#ifndef DEBUGBUILD
  147|       |  const bool env_override = FALSE;
  148|       |#endif
  149|       |
  150|      2|  DEBUGASSERT(num);
  ------------------
  |  | 1050|      2|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (150:3): [True: 0, False: 2]
  |  Branch (150:3): [True: 2, False: 0]
  ------------------
  151|       |
  152|      6|  while(num) {
  ------------------
  |  Branch (152:9): [True: 4, False: 2]
  ------------------
  153|      4|    unsigned int r;
  154|      4|    size_t left = num < sizeof(unsigned int) ? num : sizeof(unsigned int);
  ------------------
  |  Branch (154:19): [True: 0, False: 4]
  ------------------
  155|       |
  156|      4|    result = randit(data, &r, env_override);
  157|      4|    if(result)
  ------------------
  |  Branch (157:8): [True: 0, False: 4]
  ------------------
  158|      0|      return result;
  159|       |
  160|     20|    while(left) {
  ------------------
  |  Branch (160:11): [True: 16, False: 4]
  ------------------
  161|     16|      *rnd++ = (unsigned char)(r & 0xFF);
  162|     16|      r >>= 8;
  163|     16|      --num;
  164|     16|      --left;
  165|     16|    }
  166|      4|  }
  167|       |
  168|      2|  return result;
  169|      2|}
rand.c:randit:
   89|      4|{
   90|      4|#ifdef DEBUGBUILD
   91|      4|  if(env_override) {
  ------------------
  |  Branch (91:6): [True: 0, False: 4]
  ------------------
   92|      0|    char *force_entropy = getenv("CURL_ENTROPY");
   93|      0|    if(force_entropy) {
  ------------------
  |  Branch (93:8): [True: 0, False: 0]
  ------------------
   94|      0|      static unsigned int randseed;
   95|      0|      static bool seeded = FALSE;
  ------------------
  |  | 1023|      0|#define FALSE false
  ------------------
   96|       |
   97|      0|      if(!seeded) {
  ------------------
  |  Branch (97:10): [True: 0, False: 0]
  ------------------
   98|      0|        unsigned int seed = 0;
   99|      0|        size_t elen = strlen(force_entropy);
  100|      0|        size_t clen = sizeof(seed);
  101|      0|        size_t min = elen < clen ? elen : clen;
  ------------------
  |  Branch (101:22): [True: 0, False: 0]
  ------------------
  102|      0|        memcpy((char *)&seed, force_entropy, min);
  103|      0|        randseed = ntohl(seed);
  104|      0|        seeded = TRUE;
  ------------------
  |  | 1020|      0|#define TRUE true
  ------------------
  105|      0|      }
  106|      0|      else
  107|      0|        randseed++;
  108|      0|      *rnd = randseed;
  109|      0|      return CURLE_OK;
  110|      0|    }
  111|      0|  }
  112|       |#else
  113|       |  (void)env_override;
  114|       |#endif
  115|       |
  116|       |  /* data may be NULL! */
  117|      4|#ifdef USE_SSL
  118|      4|  return Curl_ssl_random(data, (unsigned char *)rnd, sizeof(*rnd));
  119|       |#else
  120|       |  return weak_random(data, (unsigned char *)rnd, sizeof(*rnd));
  121|       |#endif
  122|      4|}

Curl_req_init:
   38|    813|{
   39|    813|  memset(req, 0, sizeof(*req));
   40|    813|}
Curl_req_free:
  175|    813|{
  176|    813|  curlx_safefree(req->newurl);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  177|    813|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  178|    813|#ifndef CURL_DISABLE_PROXY
  179|    813|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  180|    813|#endif
  181|    813|  if(req->sendbuf_init)
  ------------------
  |  Branch (181:6): [True: 0, False: 813]
  ------------------
  182|      0|    Curl_bufq_free(&req->sendbuf);
  183|    813|  Curl_client_cleanup(data);
  184|    813|}

Curl_client_cleanup:
   72|    813|{
   73|    813|  cl_reset_reader(data);
   74|    813|  cl_reset_writer(data);
   75|       |
   76|    813|  data->req.bytecount = 0;
   77|    813|  data->req.headerline = 0;
   78|    813|}
sendf.c:cl_reset_reader:
   60|    813|{
   61|    813|  struct Curl_creader *reader = data->req.reader.stack;
   62|    813|  data->req.reader_started = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
   63|    813|  while(reader) {
  ------------------
  |  Branch (63:9): [True: 0, False: 813]
  ------------------
   64|      0|    data->req.reader.stack = reader->next;
   65|      0|    reader->crt->do_close(data, reader);
   66|      0|    curlx_free(reader);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   67|      0|    reader = data->req.reader.stack;
   68|      0|  }
   69|    813|}
sendf.c:cl_reset_writer:
   48|    813|{
   49|    813|  struct Curl_cwriter *writer = data->req.writer.stack;
   50|    813|  while(writer) {
  ------------------
  |  Branch (50:9): [True: 0, False: 813]
  ------------------
   51|      0|    data->req.writer.stack = writer->next;
   52|      0|    writer->cwt->do_close(data, writer);
   53|      0|    curlx_free(writer);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   54|      0|    writer = data->req.writer.stack;
   55|      0|  }
   56|       |  data->req.writer.paused = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
   57|    813|}

Curl_setopt_SSLVERSION:
  295|  1.62k|{
  296|       |  /*
  297|       |   * Set explicit SSL version to try to connect with, as some SSL
  298|       |   * implementations are lame.
  299|       |   */
  300|  1.62k|  {
  301|  1.62k|    long version, version_max;
  302|  1.62k|    struct ssl_easy_config *sslc = &data->set.ssl;
  303|  1.62k|#ifndef CURL_DISABLE_PROXY
  304|  1.62k|    if(option != CURLOPT_SSLVERSION)
  ------------------
  |  Branch (304:8): [True: 813, False: 813]
  ------------------
  305|    813|      sslc = &data->set.proxy_ssl;
  306|       |#else
  307|       |    (void)option; /* unused */
  308|       |#endif
  309|  1.62k|    version = C_SSLVERSION_VALUE(arg);
  ------------------
  |  |  172|  1.62k|#define C_SSLVERSION_VALUE(x)     ((x) & 0xffff)
  ------------------
  310|  1.62k|    version_max = (long)C_SSLVERSION_MAX_VALUE(arg);
  ------------------
  |  |  173|  1.62k|#define C_SSLVERSION_MAX_VALUE(x) ((unsigned long)(x) & 0xffff0000)
  ------------------
  311|       |
  312|  1.62k|    if(version < CURL_SSLVERSION_DEFAULT ||
  ------------------
  |  | 2394|  3.25k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (312:8): [True: 0, False: 1.62k]
  ------------------
  313|  1.62k|       version == CURL_SSLVERSION_SSLv2 ||
  ------------------
  |  | 2396|  3.25k|#define CURL_SSLVERSION_SSLv2   2L
  ------------------
  |  Branch (313:8): [True: 0, False: 1.62k]
  ------------------
  314|  1.62k|       version == CURL_SSLVERSION_SSLv3 ||
  ------------------
  |  | 2397|  3.25k|#define CURL_SSLVERSION_SSLv3   3L
  ------------------
  |  Branch (314:8): [True: 0, False: 1.62k]
  ------------------
  315|  1.62k|       version >= CURL_SSLVERSION_LAST ||
  ------------------
  |  | 2403|  3.25k|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  ------------------
  |  Branch (315:8): [True: 0, False: 1.62k]
  ------------------
  316|  1.62k|       version_max < CURL_SSLVERSION_MAX_NONE ||
  ------------------
  |  | 2405|  3.25k|#define CURL_SSLVERSION_MAX_NONE 0L
  ------------------
  |  Branch (316:8): [True: 0, False: 1.62k]
  ------------------
  317|  1.62k|       version_max >= CURL_SSLVERSION_MAX_LAST)
  ------------------
  |  | 2413|  1.62k|#define CURL_SSLVERSION_MAX_LAST    (CURL_SSLVERSION_LAST    << 16)
  |  |  ------------------
  |  |  |  | 2403|  1.62k|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  |  |  ------------------
  ------------------
  |  Branch (317:8): [True: 0, False: 1.62k]
  ------------------
  318|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  319|  1.62k|    if(version == CURL_SSLVERSION_DEFAULT)
  ------------------
  |  | 2394|  1.62k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (319:8): [True: 1.62k, False: 0]
  ------------------
  320|  1.62k|      version = CURL_SSLVERSION_TLSv1_2;
  ------------------
  |  | 2400|  1.62k|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  321|       |
  322|  1.62k|    sslc->version = (unsigned char)version;
  323|  1.62k|    sslc->version_max = (unsigned int)version_max;
  324|  1.62k|  }
  325|      0|  return CURLE_OK;
  326|  1.62k|}

easy.c:sigpipe_ignore:
   49|    813|{
   50|       |  /* get a local copy of no_signal because the Curl_easy might not be
   51|       |     around when we restore */
   52|    813|  ig->no_signal = data->set.no_signal;
   53|    813|  if(!data->set.no_signal) {
  ------------------
  |  Branch (53:6): [True: 813, False: 0]
  ------------------
   54|    813|    struct sigaction action;
   55|       |    /* first, extract the existing situation */
   56|    813|    sigaction(SIGPIPE, NULL, &ig->old_pipe_act);
   57|    813|    action = ig->old_pipe_act;
   58|       |    /* ignore this signal */
   59|    813|    action.sa_handler = SIG_IGN;
   60|    813|#ifdef SA_SIGINFO
   61|       |    /* clear SA_SIGINFO flag since we are using sa_handler */
   62|    813|    action.sa_flags &= ~SA_SIGINFO;
   63|    813|#endif
   64|    813|    sigaction(SIGPIPE, &action, NULL);
   65|    813|  }
   66|    813|}
easy.c:sigpipe_restore:
   74|    813|{
   75|    813|  if(!ig->no_signal)
  ------------------
  |  Branch (75:6): [True: 813, False: 0]
  ------------------
   76|       |    /* restore the outside state */
   77|    813|    sigaction(SIGPIPE, &ig->old_pipe_act, NULL);
   78|    813|}

curl_slist_free_all:
  126|  1.62k|{
  127|  1.62k|  struct curl_slist *next;
  128|  1.62k|  struct curl_slist *item;
  129|       |
  130|  1.62k|  if(!list)
  ------------------
  |  Branch (130:6): [True: 1.62k, False: 0]
  ------------------
  131|  1.62k|    return;
  132|       |
  133|      0|  item = list;
  134|      0|  do {
  135|      0|    next = item->next;
  136|      0|    curlx_safefree(item->data);
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  137|      0|    curlx_free(item);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  138|      0|    item = next;
  139|      0|  } while(next);
  ------------------
  |  Branch (139:11): [True: 0, False: 0]
  ------------------
  140|      0|}

Curl_timestrcmp:
  117|  2.18k|{
  118|  2.18k|  int match = 0;
  119|  2.18k|  int i = 0;
  120|       |
  121|  2.18k|  if(a && b) {
  ------------------
  |  Branch (121:6): [True: 2.18k, False: 0]
  |  Branch (121:11): [True: 2.18k, False: 0]
  ------------------
  122|  19.0k|    while(1) {
  ------------------
  |  Branch (122:11): [True: 19.0k, Folded]
  ------------------
  123|  19.0k|      match |= a[i] ^ b[i];
  124|  19.0k|      if(!a[i] || !b[i])
  ------------------
  |  Branch (124:10): [True: 1.84k, False: 17.1k]
  |  Branch (124:19): [True: 336, False: 16.8k]
  ------------------
  125|  2.18k|        break;
  126|  16.8k|      i++;
  127|  16.8k|    }
  128|  2.18k|  }
  129|      0|  else
  130|      0|    return a || b;
  ------------------
  |  Branch (130:12): [True: 0, False: 0]
  |  Branch (130:17): [True: 0, False: 0]
  ------------------
  131|  2.18k|  return match;
  132|  2.18k|}

strequal.c:Curl_raw_toupper:
   38|   183k|{
   39|   183k|  return (char)Curl_touppermap[(unsigned char)in];
   40|   183k|}

curl_strequal:
   77|    578|{
   78|    578|  if(s1 && s2)
  ------------------
  |  Branch (78:6): [True: 578, False: 0]
  |  Branch (78:12): [True: 578, False: 0]
  ------------------
   79|       |    /* both pointers point to something then compare them */
   80|    578|    return casecompare(s1, s2);
   81|       |
   82|       |  /* if both pointers are NULL then treat them as equal */
   83|      0|  return NULL == s1 && NULL == s2;
  ------------------
  |  Branch (83:10): [True: 0, False: 0]
  |  Branch (83:24): [True: 0, False: 0]
  ------------------
   84|    578|}
curl_strnequal:
   88|  22.9k|{
   89|  22.9k|  if(s1 && s2)
  ------------------
  |  Branch (89:6): [True: 22.9k, False: 0]
  |  Branch (89:12): [True: 22.9k, False: 0]
  ------------------
   90|       |    /* both pointers point to something then compare them */
   91|  22.9k|    return ncasecompare(s1, s2, n);
   92|       |
   93|       |  /* if both pointers are NULL then treat them as equal if max is non-zero */
   94|      0|  return NULL == s1 && NULL == s2 && n;
  ------------------
  |  Branch (94:10): [True: 0, False: 0]
  |  Branch (94:24): [True: 0, False: 0]
  |  Branch (94:38): [True: 0, False: 0]
  ------------------
   95|  22.9k|}
strequal.c:casecompare:
   36|    578|{
   37|  3.41k|  while(*first) {
  ------------------
  |  Branch (37:9): [True: 3.13k, False: 281]
  ------------------
   38|  3.13k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (38:8): [True: 297, False: 2.83k]
  ------------------
   39|       |      /* get out of the loop as soon as they do not match */
   40|    297|      return 0;
   41|  2.83k|    first++;
   42|  2.83k|    second++;
   43|  2.83k|  }
   44|       |  /* If we are here either the strings are the same or the length is different.
   45|       |     We can test if the "current" character is non-zero for one and zero
   46|       |     for the other. Note that the characters may not be exactly the same even
   47|       |     if they match, we only want to compare zero-ness. */
   48|    281|  return !*first == !*second;
   49|    578|}
strequal.c:ncasecompare:
   52|  22.9k|{
   53|   100k|  while(*first && max) {
  ------------------
  |  Branch (53:9): [True: 100k, False: 0]
  |  Branch (53:19): [True: 88.3k, False: 12.0k]
  ------------------
   54|  88.3k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (54:8): [True: 10.8k, False: 77.5k]
  ------------------
   55|  10.8k|      return 0;
   56|  77.5k|    max--;
   57|  77.5k|    first++;
   58|  77.5k|    second++;
   59|  77.5k|  }
   60|  12.0k|  if(max == 0)
  ------------------
  |  Branch (60:6): [True: 12.0k, False: 0]
  ------------------
   61|  12.0k|    return 1; /* they are equal this far */
   62|       |
   63|      0|  return Curl_raw_toupper(*first) == Curl_raw_toupper(*second);
   64|  12.0k|}

Curl_u8_strset_init:
   64|  2.43k|{
   65|       |#if defined(__GNUC__) && __GNUC__ >= 13
   66|       |#pragma GCC diagnostic push
   67|       |#pragma GCC diagnostic ignored "-Warray-bounds"
   68|       |#endif
   69|  2.43k|  memset(set, 0, sizeof(*set));
   70|       |#if defined(__GNUC__) && __GNUC__ >= 13
   71|       |#pragma GCC diagnostic pop
   72|       |#endif
   73|  2.43k|  set->data = set->sdata;
   74|  2.43k|  set->ids = set->sids;
   75|  2.43k|  set->psl = set->spsl;
   76|  2.43k|  set->slotbits = CURL_U8_STRSET_START_BITS;
  ------------------
  |  |   39|  2.43k|#define CURL_U8_STRSET_START_BITS   3
  ------------------
   77|  2.43k|  set->slotmask = CURL_U8_SLOT_MASK(set->slotbits);
  ------------------
  |  |   40|  2.43k|#define CURL_U8_SLOT_MASK(i)             (uint8_t)((1U << (i)) - 1)
  ------------------
   78|  2.43k|  set->count = 0;
   79|  2.43k|#ifdef DEBUGBUILD
   80|  2.43k|  set->init = CURL_U8_STRSET_MAGIC;
  ------------------
  |  |   31|  2.43k|#define CURL_U8_STRSET_MAGIC 0x7117e783
  ------------------
   81|  2.43k|#endif
   82|  2.43k|}
Curl_u8_strset_clear:
   85|    813|{
   86|    813|  uint16_t i;
   87|    813|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:3): [True: 0, False: 813]
  |  Branch (87:3): [True: 813, False: 0]
  ------------------
   88|  7.31k|  for(i = 0; i < CURL_U8_STRSET_SLOT_CNT(set); ++i)
  ------------------
  |  |   41|  7.31k|#define CURL_U8_STRSET_SLOT_CNT(s)       CURL_U8_SLOT_CNT((s)->slotbits)
  |  |  ------------------
  |  |  |  |   39|  7.31k|#define CURL_U8_SLOT_CNT(i)              (uint16_t)((i) ? (1U << (i)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:53): [True: 7.31k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (88:14): [True: 6.50k, False: 813]
  ------------------
   89|  6.50k|    curlx_safefree(set->data[i]);
  ------------------
  |  | 1371|  7.31k|  do {                      \
  |  | 1372|  6.50k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  6.50k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  6.50k|    (ptr) = NULL;           \
  |  | 1374|  6.50k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 6.50k]
  |  |  ------------------
  ------------------
   90|       |
   91|    813|  if(set->data != set->sdata)
  ------------------
  |  Branch (91:6): [True: 0, False: 813]
  ------------------
   92|       |    curlx_safefree(set->data);
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
   93|    813|  Curl_u8_strset_init(set);
   94|    813|}
Curl_u8_strset_get:
  199|  1.62k|{
  200|  1.62k|  uint8_t i;
  201|  1.62k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1050|  1.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 1.62k]
  |  Branch (201:3): [True: 1.62k, False: 0]
  ------------------
  202|  1.62k|  if(u8_strset_get_index(set, id, &i))
  ------------------
  |  Branch (202:6): [True: 0, False: 1.62k]
  ------------------
  203|      0|    return set->data[i];
  204|  1.62k|  return NULL;
  205|  1.62k|}
Curl_u8_strset_unset0:
  295|  4.06k|{
  296|       |  u8_strset_unset(set, id, TRUE);
  ------------------
  |  | 1020|  4.06k|#define TRUE true
  ------------------
  297|  4.06k|}
u8_strset.c:u8_strset_get_index:
  169|  5.69k|{
  170|  5.69k|  uint8_t i = CURL_U8_STRSET_SLOT_IDX(set, id);
  ------------------
  |  |   38|  5.69k|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  171|  5.69k|  uint8_t psl = 0;
  172|  5.69k|  while(set->data[i] && (psl <= set->psl[i])) {
  ------------------
  |  Branch (172:9): [True: 0, False: 5.69k]
  |  Branch (172:25): [True: 0, False: 0]
  ------------------
  173|      0|    if(set->ids[i] == id) {
  ------------------
  |  Branch (173:8): [True: 0, False: 0]
  ------------------
  174|      0|      *pindex = i;
  175|       |#if CURL_U8_STRSET_DEBUG
  176|       |      curl_mfprintf(stderr, "u8_strset_index %d=%s\n", id, set->data[i]);
  177|       |#endif
  178|      0|      return TRUE;
  ------------------
  |  | 1020|      0|#define TRUE true
  ------------------
  179|      0|    }
  180|      0|    i = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|      0|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  181|      0|    ++psl;
  182|      0|  }
  183|       |#if CURL_U8_STRSET_DEBUG
  184|       |  curl_mfprintf(stderr, "u8_strset_index %d not found\n", id);
  185|       |#endif
  186|  5.69k|  *pindex = 0;
  187|       |  return FALSE;
  ------------------
  |  | 1023|  5.69k|#define FALSE false
  ------------------
  188|  5.69k|}
u8_strset.c:u8_strset_unset:
  264|  4.06k|{
  265|  4.06k|  uint8_t i, j;
  266|       |
  267|  4.06k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1050|  4.06k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (267:3): [True: 0, False: 4.06k]
  |  Branch (267:3): [True: 4.06k, False: 0]
  ------------------
  268|  4.06k|  if(u8_strset_get_index(set, id, &i)) {
  ------------------
  |  Branch (268:6): [True: 0, False: 4.06k]
  ------------------
  269|       |    /* `id` is in set */
  270|      0|    if(zero)
  ------------------
  |  Branch (270:8): [True: 0, False: 0]
  ------------------
  271|      0|      curlx_strzero(set->data[i]);
  272|      0|    curlx_safefree(set->data[i]);
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  273|      0|    set->ids[i] = set->psl[i] = 0;
  274|      0|    --set->count;
  275|      0|    j = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|      0|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  276|       |    /* shift all entries with positive psl "down" */
  277|      0|    while(set->data[j] && set->psl[j]) {
  ------------------
  |  Branch (277:11): [True: 0, False: 0]
  |  Branch (277:27): [True: 0, False: 0]
  ------------------
  278|      0|      set->data[i] = set->data[j];
  279|      0|      set->ids[i] = set->ids[j];
  280|      0|      set->psl[i] = (uint8_t)(set->psl[j] - 1);
  281|      0|      set->data[j] = NULL;
  282|      0|      set->ids[j] = set->psl[j] = 0;
  283|      0|      i = j;
  284|      0|      j = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|      0|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  285|      0|    }
  286|      0|  }
  287|  4.06k|}

Curl_freeset:
  148|    813|{
  149|       |  /* Free all dynamic strings stored in the data->set substructure. */
  150|    813|  enum dupblob j;
  151|       |
  152|    813|  CURL_EASY_STR_CLEAR0(data, STRING_PASSWORD);
  ------------------
  |  | 1232|    813|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  153|    813|  CURL_EASY_STR_CLEAR0(data, STRING_KEY_PASSWD);
  ------------------
  |  | 1232|    813|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  154|    813|  CURL_EASY_STR_CLEAR0(data, STRING_BEARER);
  ------------------
  |  | 1232|    813|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  155|    813|#ifndef CURL_DISABLE_PROXY
  156|    813|  CURL_EASY_STR_CLEAR0(data, STRING_PROXYPASSWORD);
  ------------------
  |  | 1232|    813|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  157|    813|  CURL_EASY_STR_CLEAR0(data, STRING_KEY_PASSWD_PROXY);
  ------------------
  |  | 1232|    813|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  158|    813|#endif
  159|    813|  Curl_u8_strset_clear(&data->set.strings);
  160|    813|  curlx_safefree(data->set.str_copypostfields);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  161|       |
  162|  7.31k|  for(j = (enum dupblob)0; j < BLOB_LAST; j++) {
  ------------------
  |  Branch (162:28): [True: 6.50k, False: 813]
  ------------------
  163|  6.50k|    curlx_safefree(data->set.blobs[j]);
  ------------------
  |  | 1371|  6.50k|  do {                      \
  |  | 1372|  6.50k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  6.50k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  6.50k|    (ptr) = NULL;           \
  |  | 1374|  6.50k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 6.50k]
  |  |  ------------------
  ------------------
  164|  6.50k|  }
  165|       |
  166|    813|  Curl_bufref_free(&data->state.referer);
  167|    813|  Curl_bufref_free(&data->state.url);
  168|       |
  169|    813|#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
  170|    813|  Curl_mime_cleanpart(data->set.mimepostp);
  171|    813|  curlx_safefree(data->set.mimepostp);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  172|    813|#endif
  173|       |
  174|    813|#ifndef CURL_DISABLE_COOKIES
  175|    813|  curl_slist_free_all(data->state.cookielist);
  176|       |  data->state.cookielist = NULL;
  177|    813|#endif
  178|    813|}
Curl_close:
  198|    813|{
  199|    813|  struct Curl_easy *data;
  200|       |
  201|    813|  if(!datap || !*datap)
  ------------------
  |  Branch (201:6): [True: 0, False: 813]
  |  Branch (201:16): [True: 0, False: 813]
  ------------------
  202|      0|    return CURLE_OK;
  203|       |
  204|    813|  data = *datap;
  205|    813|  *datap = NULL;
  206|       |
  207|    813|  if(!data->state.internal && data->multi) {
  ------------------
  |  Branch (207:6): [True: 813, False: 0]
  |  Branch (207:31): [True: 0, False: 813]
  ------------------
  208|       |    /* This handle is still part of a multi handle, take care of this first
  209|       |       and detach this handle from there.
  210|       |       This detaches the connection. */
  211|      0|    Curl_multi_remove_handle(data->multi, data);
  212|      0|  }
  213|    813|  else {
  214|       |    /* Detach connection if any is left. This should not be normal, but can be
  215|       |       the case for example with CONNECT_ONLY + recv/send (test 556) */
  216|    813|    Curl_detach_connection(data);
  217|    813|    if(!data->state.internal && data->multi_easy) {
  ------------------
  |  Branch (217:8): [True: 813, False: 0]
  |  Branch (217:33): [True: 0, False: 813]
  ------------------
  218|       |      /* when curl_easy_perform() is used, it creates its own multi handle to
  219|       |         use and this is the one */
  220|      0|      curl_multi_cleanup(data->multi_easy);
  221|      0|      data->multi_easy = NULL;
  222|      0|    }
  223|    813|  }
  224|    813|  DEBUGASSERT(!data->conn || data->state.internal);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (224:3): [True: 813, False: 0]
  |  Branch (224:3): [True: 0, False: 0]
  |  Branch (224:3): [True: 813, False: 0]
  |  Branch (224:3): [True: 0, False: 0]
  ------------------
  225|       |
  226|    813|  Curl_expire_clear_all(data); /* shut off any timers left */
  227|       |
  228|    813|  if(data->state.rangestringalloc)
  ------------------
  |  Branch (228:6): [True: 0, False: 813]
  ------------------
  229|      0|    curlx_free(data->state.range);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  230|       |
  231|       |  /* release any resolve information this transfer kept */
  232|    813|  Curl_resolv_destroy_all(data);
  233|       |
  234|    813|  data->set.verbose = FALSE; /* no more calls to DEBUGFUNCTION */
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  235|    813|  data->magic = 0; /* force a clear AFTER the possibly enforced removal from
  236|       |                    * the multi handle and async dns shutdown. The multi
  237|       |                    * handle might check the magic and so might any
  238|       |                    * DEBUGFUNCTION invoked for tracing */
  239|       |
  240|       |  /* freed here in case DONE was not called */
  241|    813|  Curl_req_free(&data->req, data);
  242|       |
  243|       |  /* Close down all open SSL info and sessions */
  244|    813|  Curl_ssl_close_all(data);
  245|    813|  Curl_peer_unlink(&data->state.origin);
  246|    813|  Curl_peer_unlink(&data->state.initial_origin);
  247|    813|#ifndef CURL_DISABLE_RTSP
  248|    813|  Curl_peer_unlink(&data->state.rtsp_session_origin);
  249|    813|#endif
  250|    813|  Curl_ssl_free_certinfo(data);
  251|       |
  252|    813|  Curl_bufref_free(&data->state.referer);
  253|       |
  254|    813|  up_free(data);
  255|    813|  curlx_dyn_free(&data->state.headerb);
  256|    813|  Curl_flush_cookies(data, TRUE);
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  257|    813|#ifndef CURL_DISABLE_ALTSVC
  258|    813|  Curl_altsvc_save(data, data->asi, CURL_EASY_STR(data, STRING_ALTSVC));
  ------------------
  |  | 1224|    813|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  259|    813|  Curl_altsvc_cleanup(&data->asi);
  260|    813|#endif
  261|    813|#ifndef CURL_DISABLE_HSTS
  262|    813|  Curl_hsts_save(data, data->hsts, CURL_EASY_STR(data, STRING_HSTS));
  ------------------
  |  | 1224|    813|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  263|    813|  if(!data->share || !data->share->hsts)
  ------------------
  |  Branch (263:6): [True: 813, False: 0]
  |  Branch (263:22): [True: 0, False: 0]
  ------------------
  264|    813|    Curl_hsts_cleanup(&data->hsts);
  265|    813|  curl_slist_free_all(data->state.hstslist); /* clean up list */
  266|    813|#endif
  267|    813|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH)
  268|    813|  Curl_http_auth_cleanup_digest(data);
  269|    813|#endif
  270|    813|  curlx_safefree(data->state.most_recent_ftp_entrypath);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  271|    813|  curlx_safefree(data->info.contenttype);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  272|    813|  curlx_safefree(data->info.wouldredirect);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  273|    813|  curlx_safefree(data->info.effective_url);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  274|       |
  275|       |  /* No longer a dirty share, if it exists */
  276|    813|  if(Curl_share_easy_unlink(data))
  ------------------
  |  Branch (276:6): [True: 0, False: 813]
  ------------------
  277|    813|    DEBUGASSERT(0);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (277:5): [Folded, False: 0]
  |  Branch (277:5): [Folded, False: 0]
  ------------------
  278|       |
  279|    813|  Curl_hash_destroy(&data->meta_hash);
  280|    813|  Curl_creds_unlink(&data->state.creds);
  281|    813|#ifndef CURL_DISABLE_HTTP
  282|    813|  curlx_safefree(data->state.rangeline);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  283|    813|  curlx_safefree(data->state.http_host);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  284|    813|#endif
  285|    813|#ifndef CURL_DISABLE_COOKIES
  286|    813|  curlx_safefree(data->req.cookiehost);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  287|    813|#endif
  288|       |
  289|    813|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_FORM_API)
  290|    813|  Curl_mime_cleanpart(data->state.formp);
  291|    813|  curlx_safefree(data->state.formp);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  292|    813|#endif
  293|       |
  294|       |  /* destruct wildcard structures if it is needed */
  295|    813|  Curl_wildcard_dtor(&data->wildcard);
  296|    813|  Curl_freeset(data);
  297|    813|  Curl_headers_cleanup(data);
  298|    813|  Curl_netrc_cleanup(&data->state.netrc);
  299|    813|#ifndef CURL_DISABLE_DIGEST_AUTH
  300|    813|  curlx_free(data->state.envproxy);
  ------------------
  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  301|    813|#endif
  302|    813|  curlx_memzero(data, sizeof(*data));
  303|    813|  curlx_free(data);
  ------------------
  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  304|    813|  return CURLE_OK;
  305|    813|}
Curl_init_userdefined:
  312|    813|{
  313|    813|  struct UserDefined *set = &data->set;
  314|       |
  315|    813|  set->out = stdout;  /* default output to stdout */
  316|    813|  set->in_set = stdin;  /* default input from stdin */
  317|    813|  set->err = stderr;  /* default stderr to stderr */
  318|       |
  319|    813|  Curl_u8_strset_init(&data->set.strings);
  320|       |
  321|    813|#if defined(__clang__) && __clang_major__ >= 16
  322|    813|#pragma clang diagnostic push
  323|    813|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
  324|    813|#endif
  325|       |  /* use fwrite as default function to store output */
  326|    813|  set->fwrite_func = (curl_write_callback)fwrite;
  327|       |
  328|       |  /* use fread as default function to read input */
  329|    813|  set->fread_func_set = (curl_read_callback)fread;
  330|    813|#if defined(__clang__) && __clang_major__ >= 16
  331|    813|#pragma clang diagnostic pop
  332|    813|#endif
  333|    813|  set->is_fread_set = 0;
  334|       |
  335|    813|  set->seek_client = ZERO_NULL;
  ------------------
  |  | 1197|    813|#define ZERO_NULL 0
  ------------------
  336|       |
  337|    813|  set->filesize = -1;        /* we do not know the size */
  338|    813|  set->postfieldsize = -1;   /* unknown size */
  339|    813|  set->maxredirs = 30;       /* sensible default */
  340|       |
  341|    813|  set->method = HTTPREQ_GET; /* Default HTTP request */
  342|    813|#ifndef CURL_DISABLE_RTSP
  343|    813|  set->rtspreq = RTSPREQ_OPTIONS; /* Default RTSP request */
  ------------------
  |  |   34|    813|#define RTSPREQ_OPTIONS CURL_RTSPREQ_OPTIONS
  |  |  ------------------
  |  |  |  | 2367|    813|#define CURL_RTSPREQ_OPTIONS       1L
  |  |  ------------------
  ------------------
  344|    813|#endif
  345|    813|#ifndef CURL_DISABLE_FTP
  346|    813|  set->ftp_use_epsv = TRUE;   /* FTP defaults to EPSV operations */
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  347|    813|  set->ftp_use_eprt = TRUE;   /* FTP defaults to EPRT operations */
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  348|    813|  set->ftp_use_pret = FALSE;  /* mainly useful for drftpd servers */
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  349|    813|  set->ftp_filemethod = FTPFILE_MULTICWD;
  350|    813|  set->ftp_skip_ip = TRUE;    /* skip PASV IP by default */
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  351|    813|#endif
  352|    813|  set->dns_cache_timeout_ms = 60000; /* Timeout every 60 seconds by default */
  353|       |
  354|       |  /* Timeout every 24 hours by default */
  355|    813|  set->ssl_ca_cache_timeout = 24 * 60 * 60;
  356|       |
  357|    813|  set->httpauth = CURLAUTH_BASIC;  /* defaults to basic */
  ------------------
  |  |  833|    813|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  358|       |
  359|    813|  Curl_ssl_config_init(&data->set.ssl);
  360|    813|#ifndef CURL_DISABLE_PROXY
  361|    813|  Curl_ssl_config_init(&data->set.proxy_ssl);
  362|    813|  set->proxyport = 0;
  363|    813|  set->proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
  ------------------
  |  |  792|    813|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  364|    813|  set->proxyauth = CURLAUTH_BASIC; /* defaults to basic */
  ------------------
  |  |  833|    813|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  365|       |  /* SOCKS5 proxy auth defaults to username/password + GSS-API */
  366|    813|  set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  833|    813|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  839|    813|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  835|    813|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  367|    813|#endif
  368|       |
  369|    813|#ifndef CURL_DISABLE_DOH
  370|    813|  set->doh_verifyhost = TRUE;
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  371|    813|  set->doh_verifypeer = TRUE;
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  372|    813|#endif
  373|       |#ifdef USE_SSH
  374|       |  /* defaults to any auth type */
  375|       |  set->ssh_auth_types = CURLSSH_AUTH_DEFAULT;
  376|       |  set->new_directory_perms = 0755; /* Default permissions */
  377|       |#endif
  378|       |
  379|    813|  set->new_file_perms = 0644;    /* Default permissions */
  380|    813|  set->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
  ------------------
  |  |   66|    813|#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
  ------------------
  381|    813|  set->redir_protocols = CURLPROTO_REDIR;
  ------------------
  |  |   69|    813|#define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1088|    813|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1089|    813|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1090|    813|#define CURLPROTO_FTP     (1L << 2)
  |  |  ------------------
  |  |   70|    813|                         CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1091|    813|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
  382|       |
  383|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  384|       |  /*
  385|       |   * disallow unprotected protection negotiation NEC reference implementation
  386|       |   * seem not to follow rfc1961 section 4.3/4.4
  387|       |   */
  388|       |  set->socks5_gssapi_nec = FALSE;
  389|       |#endif
  390|       |
  391|       |  /* set default minimum TLS version */
  392|    813|#ifdef USE_SSL
  393|    813|  Curl_setopt_SSLVERSION(data, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2394|    813|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  394|    813|#ifndef CURL_DISABLE_PROXY
  395|    813|  Curl_setopt_SSLVERSION(data, CURLOPT_PROXY_SSLVERSION,
  396|    813|                         CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2394|    813|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  397|    813|#endif
  398|    813|#endif
  399|    813|#ifndef CURL_DISABLE_FTP
  400|    813|  set->wildcard_enabled = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  401|    813|  set->chunk_bgn = ZERO_NULL;
  ------------------
  |  | 1197|    813|#define ZERO_NULL 0
  ------------------
  402|    813|  set->chunk_end = ZERO_NULL;
  ------------------
  |  | 1197|    813|#define ZERO_NULL 0
  ------------------
  403|    813|  set->fnmatch = ZERO_NULL;
  ------------------
  |  | 1197|    813|#define ZERO_NULL 0
  ------------------
  404|    813|#endif
  405|    813|  set->tcp_keepalive = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  406|    813|  set->tcp_keepintvl = 60;
  407|    813|  set->tcp_keepidle = 60;
  408|    813|  set->tcp_keepcnt = 9;
  409|    813|  set->tcp_fastopen = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  410|    813|  set->tcp_nodelay = TRUE;
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  411|    813|  set->ssl_enable_alpn = TRUE;
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  412|    813|  set->expect_100_timeout = 1000L; /* Wait for a second by default. */
  413|    813|  set->sep_headers = TRUE; /* separated header lists by default */
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  414|    813|  set->buffer_size = READBUFFER_SIZE;
  ------------------
  |  |  120|    813|#define READBUFFER_SIZE CURL_MAX_WRITE_SIZE
  |  |  ------------------
  |  |  |  |  267|    813|#define CURL_MAX_WRITE_SIZE 16384
  |  |  ------------------
  ------------------
  415|    813|  set->upload_buffer_size = UPLOADBUFFER_DEFAULT;
  ------------------
  |  |  132|    813|#define UPLOADBUFFER_DEFAULT 65536
  ------------------
  416|    813|  set->upload_flags = CURLULFLAG_SEEN;
  ------------------
  |  | 1054|    813|#define CURLULFLAG_SEEN     (1L << 4)
  ------------------
  417|    813|  set->happy_eyeballs_timeout = CURL_HET_DEFAULT;
  ------------------
  |  |  979|    813|#define CURL_HET_DEFAULT 200L
  ------------------
  418|    813|  set->upkeep_interval_ms = CURL_UPKEEP_INTERVAL_DEFAULT;
  ------------------
  |  |  982|    813|#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
  ------------------
  419|    813|  set->maxconnects = DEFAULT_CONNCACHE_SIZE; /* for easy handles */
  ------------------
  |  |   38|    813|#define DEFAULT_CONNCACHE_SIZE 5
  ------------------
  420|    813|  set->conn_max_idle_ms = 118 * 1000;
  421|    813|  set->conn_max_age_ms = 24 * 3600 * 1000;
  422|    813|  set->http09_allowed = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  423|    813|  set->httpwant = CURL_HTTP_VERSION_NONE;
  ------------------
  |  | 2338|    813|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  424|    813|#if defined(USE_HTTP2) || defined(USE_HTTP3)
  425|    813|  set->weight = 0;
  426|    813|#endif
  427|    813|  set->quick_exit = 0L;
  428|    813|#ifndef CURL_DISABLE_WEBSOCKETS
  429|    813|  set->ws_raw_mode = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  430|       |  set->ws_no_auto_pong = FALSE;
  ------------------
  |  | 1023|    813|#define FALSE false
  ------------------
  431|    813|#endif
  432|    813|}
Curl_open:
  453|    813|{
  454|    813|  struct Curl_easy *data;
  455|       |
  456|       |  /* simple start-up: alloc the struct, init it with zeroes and return */
  457|    813|  data = curlx_calloc(1, sizeof(struct Curl_easy));
  ------------------
  |  | 1512|    813|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  458|    813|  if(!data) {
  ------------------
  |  Branch (458:6): [True: 0, False: 813]
  ------------------
  459|       |    /* this is a serious error */
  460|      0|    DEBUGF(curl_mfprintf(stderr, "Error: calloc of Curl_easy failed\n"));
  ------------------
  |  | 1036|      0|#define DEBUGF(x) x
  ------------------
  461|      0|    return CURLE_OUT_OF_MEMORY;
  462|      0|  }
  463|       |
  464|    813|  data->magic = CURLEASY_MAGIC_NUMBER;
  ------------------
  |  |   28|    813|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  ------------------
  465|       |  /* most recent connection is not yet defined */
  466|    813|  data->state.last_conn_id = -1;
  467|    813|  data->state.last_cpid = UINT32_MAX;
  468|       |  /* and not assigned an id yet */
  469|    813|  data->id = -1;
  470|    813|  data->mid = UINT32_MAX;
  471|    813|  data->master_mid = UINT32_MAX;
  472|    813|  data->progress.hide = TRUE;
  ------------------
  |  | 1020|    813|#define TRUE true
  ------------------
  473|       |
  474|    813|  Curl_hash_init(&data->meta_hash, 23, CURL_HASH_TYPE_BYTES,
  475|    813|                 easy_meta_freeentry);
  476|    813|  DEBUGASSERT(STRING_LAST <= UINT8_MAX);
  ------------------
  |  | 1050|    813|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (476:3): [True: 0, Folded]
  |  Branch (476:3): [True: 813, Folded]
  ------------------
  477|    813|  Curl_u8_strset_init(&data->set.strings);
  478|    813|  curlx_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|    813|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  479|    813|  Curl_bufref_init(&data->state.url);
  480|    813|  Curl_bufref_init(&data->state.referer);
  481|    813|  Curl_req_init(&data->req);
  482|    813|  Curl_initinfo(data);
  483|    813|#ifndef CURL_DISABLE_HTTP
  484|    813|  Curl_llist_init(&data->state.httphdrs, NULL);
  485|    813|#endif
  486|    813|  Curl_netrc_init(&data->state.netrc);
  487|    813|  Curl_init_userdefined(data);
  488|       |
  489|    813|  *curl = data;
  490|    813|  return CURLE_OK;
  491|    813|}
url.c:up_free:
  182|    813|{
  183|    813|  struct urlpieces *up = &data->state.up;
  184|    813|  curlx_safefree(up->options);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  185|    813|  curlx_safefree(up->path);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  186|    813|  curlx_safefree(up->query);
  ------------------
  |  | 1371|    813|  do {                      \
  |  | 1372|    813|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|    813|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|    813|    (ptr) = NULL;           \
  |  | 1374|    813|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 813]
  |  |  ------------------
  ------------------
  187|    813|  curl_url_cleanup(data->state.uh);
  188|       |  data->state.uh = NULL;
  189|    813|}

curl_url_cleanup:
 1418|    813|{
 1419|    813|  if(u) {
  ------------------
  |  Branch (1419:6): [True: 0, False: 813]
  ------------------
 1420|      0|    free_urlhandle(u);
 1421|      0|    curlx_free(u);
  ------------------
  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1422|      0|  }
 1423|    813|}

Curl_auth_digest_cleanup:
 1044|  1.62k|{
 1045|  1.62k|  Curl_peer_unlink(&digest->origin);
 1046|  1.62k|  Curl_creds_unlink(&digest->creds);
 1047|  1.62k|  curlx_safefree(digest->nonce);
  ------------------
  |  | 1371|  1.62k|  do {                      \
  |  | 1372|  1.62k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  1.62k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  1.62k|    (ptr) = NULL;           \
  |  | 1374|  1.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1048|  1.62k|  curlx_safefree(digest->cnonce);
  ------------------
  |  | 1371|  1.62k|  do {                      \
  |  | 1372|  1.62k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  1.62k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  1.62k|    (ptr) = NULL;           \
  |  | 1374|  1.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1049|  1.62k|  curlx_safefree(digest->realm);
  ------------------
  |  | 1371|  1.62k|  do {                      \
  |  | 1372|  1.62k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  1.62k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  1.62k|    (ptr) = NULL;           \
  |  | 1374|  1.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1050|  1.62k|  curlx_safefree(digest->opaque);
  ------------------
  |  | 1371|  1.62k|  do {                      \
  |  | 1372|  1.62k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  1.62k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  1.62k|    (ptr) = NULL;           \
  |  | 1374|  1.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1051|  1.62k|  curlx_safefree(digest->qop);
  ------------------
  |  | 1371|  1.62k|  do {                      \
  |  | 1372|  1.62k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  1.62k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  1.62k|    (ptr) = NULL;           \
  |  | 1374|  1.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1052|  1.62k|  curlx_safefree(digest->algorithm);
  ------------------
  |  | 1371|  1.62k|  do {                      \
  |  | 1372|  1.62k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|  1.62k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|  1.62k|    (ptr) = NULL;           \
  |  | 1374|  1.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1053|       |
 1054|  1.62k|  digest->nc = 0;
 1055|  1.62k|  digest->algo = ALGO_MD5; /* default algorithm */
  ------------------
  |  |   44|  1.62k|#define ALGO_MD5 0
  ------------------
 1056|  1.62k|  digest->stale = FALSE;   /* default means normal, not stale */
  ------------------
  |  | 1023|  1.62k|#define FALSE false
  ------------------
 1057|       |  digest->userhash = FALSE;
  ------------------
  |  | 1023|  1.62k|#define FALSE false
  ------------------
 1058|  1.62k|}

Curl_async_global_init:
   81|      2|{
   82|       |#if defined(USE_ARES) && defined(CARES_HAVE_ARES_LIBRARY_INIT)
   83|       |  if(ares_library_init(ARES_LIB_INIT_ALL)) {
   84|       |    return CURLE_FAILED_INIT;
   85|       |  }
   86|       |#endif
   87|      2|  return CURLE_OK;
   88|      2|}

Curl_resolv_destroy_all:
 1175|    813|{
 1176|    813|  while(data->state.async) {
  ------------------
  |  Branch (1176:9): [True: 0, False: 813]
  ------------------
 1177|      0|    struct Curl_resolv_async *async = data->state.async;
 1178|      0|    data->state.async = async->next;
 1179|      0|    Curl_async_destroy(data, async);
 1180|      0|  }
 1181|    813|}

Curl_tls_keylog_open:
   39|      2|{
   40|      2|  if(!keylog_file_fp) {
  ------------------
  |  Branch (40:6): [True: 2, False: 0]
  ------------------
   41|      2|    keylog_file_name = getenv("SSLKEYLOGFILE");
   42|      2|    if(keylog_file_name) {
  ------------------
  |  Branch (42:8): [True: 0, False: 2]
  ------------------
   43|      0|      keylog_file_fp = curlx_fopen(keylog_file_name, FOPEN_APPENDTEXT);
  ------------------
  |  |   83|      0|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
   44|      0|      if(keylog_file_fp) {
  ------------------
  |  Branch (44:10): [True: 0, False: 0]
  ------------------
   45|       |#ifdef _WIN32
   46|       |        if(setvbuf(keylog_file_fp, NULL, _IONBF, 0))
   47|       |#else
   48|      0|        if(setvbuf(keylog_file_fp, NULL, _IOLBF, 4096))
  ------------------
  |  Branch (48:12): [True: 0, False: 0]
  ------------------
   49|      0|#endif
   50|      0|        {
   51|      0|          curlx_fclose(keylog_file_fp);
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
   52|       |          keylog_file_fp = NULL;
   53|      0|        }
   54|      0|      }
   55|      0|    }
   56|      2|  }
   57|      2|}

openssl.c:rand_enough:
  806|      4|{
  807|      4|  return RAND_status() != 0;
  808|      4|}
openssl.c:ossl_init:
 1632|      2|{
 1633|      2|  const uint64_t flags =
 1634|      2|#ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN
 1635|       |    /* not present in BoringSSL */
 1636|      2|    OPENSSL_INIT_ENGINE_ALL_BUILTIN |
 1637|      2|#endif
 1638|       |#ifdef CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
 1639|       |    OPENSSL_INIT_NO_LOAD_CONFIG |
 1640|       |#else
 1641|      2|    OPENSSL_INIT_LOAD_CONFIG |
 1642|      2|#endif
 1643|      2|    0;
 1644|      2|  OPENSSL_init_ssl(flags, NULL);
 1645|       |
 1646|      2|#ifndef HAVE_KEYLOG_UPSTREAM
 1647|      2|  Curl_tls_keylog_open();
 1648|      2|#endif
 1649|       |
 1650|      2|  return 1;
 1651|      2|}
openssl.c:ossl_random:
 5508|      4|{
 5509|      4|  int rc;
 5510|      4|  if(data) {
  ------------------
  |  Branch (5510:6): [True: 0, False: 4]
  ------------------
 5511|      0|    if(ossl_seed(data)) /* Initiate the seed if not already done */
  ------------------
  |  Branch (5511:8): [True: 0, False: 0]
  ------------------
 5512|      0|      return CURLE_FAILED_INIT; /* could not seed for some reason */
 5513|      0|  }
 5514|      4|  else {
 5515|      4|    if(!rand_enough())
  ------------------
  |  Branch (5515:8): [True: 0, False: 4]
  ------------------
 5516|      0|      return CURLE_FAILED_INIT;
 5517|      4|  }
 5518|       |  /* RAND_bytes() returns 1 on success, 0 otherwise. */
 5519|      4|  rc = RAND_bytes(entropy, (ossl_valsize_t)curlx_uztosi(length));
 5520|      4|  return rc == 1 ? CURLE_OK : CURLE_FAILED_INIT;
  ------------------
  |  Branch (5520:10): [True: 4, False: 0]
  ------------------
 5521|      4|}
openssl.c:ossl_close_all:
 2016|    813|{
 2017|    813|  (void)data;
 2018|    813|}

Curl_ssl_init:
  152|      2|{
  153|       |  /* make sure this is only done once */
  154|      2|  if(init_ssl)
  ------------------
  |  Branch (154:6): [True: 0, False: 2]
  ------------------
  155|      0|    return 1;
  156|      2|  init_ssl = TRUE; /* never again */
  ------------------
  |  | 1020|      2|#define TRUE true
  ------------------
  157|       |
  158|      2|  if(Curl_ssl->init)
  ------------------
  |  Branch (158:6): [True: 2, False: 0]
  ------------------
  159|      2|    return Curl_ssl->init();
  160|      0|  return 1;
  161|      2|}
Curl_ssl_close_all:
  228|    813|{
  229|    813|  if(Curl_ssl->close_all)
  ------------------
  |  Branch (229:6): [True: 813, False: 0]
  ------------------
  230|    813|    Curl_ssl->close_all(data);
  231|    813|}
Curl_ssl_free_certinfo:
  279|  1.62k|{
  280|  1.62k|  struct curl_certinfo *ci = &data->info.certs;
  281|       |
  282|  1.62k|  if(ci->num_of_certs) {
  ------------------
  |  Branch (282:6): [True: 0, False: 1.62k]
  ------------------
  283|       |    /* free all individual lists used */
  284|      0|    int i;
  285|      0|    for(i = 0; i < ci->num_of_certs; i++) {
  ------------------
  |  Branch (285:16): [True: 0, False: 0]
  ------------------
  286|      0|      curl_slist_free_all(ci->certinfo[i]);
  287|      0|      ci->certinfo[i] = NULL;
  288|      0|    }
  289|       |
  290|       |    curlx_safefree(ci->certinfo); /* free the actual array too */
  ------------------
  |  | 1371|      0|  do {                      \
  |  | 1372|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1515|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1373|      0|    (ptr) = NULL;           \
  |  | 1374|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1374:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  291|      0|    ci->num_of_certs = 0;
  292|      0|  }
  293|  1.62k|}
Curl_ssl_random:
  351|      4|{
  352|      4|  DEBUGASSERT(length == sizeof(int));
  ------------------
  |  | 1050|      4|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (352:3): [True: 0, False: 4]
  |  Branch (352:3): [True: 4, False: 0]
  ------------------
  353|      4|  if(Curl_ssl->random)
  ------------------
  |  Branch (353:6): [True: 4, False: 0]
  ------------------
  354|      4|    return Curl_ssl->random(data, buffer, length);
  355|      0|  else
  356|      0|    return CURLE_NOT_BUILT_IN;
  357|      4|}

Curl_ssl_config_init:
  101|  1.62k|{
  102|       |  /*
  103|       |   * libcurl 7.10 introduced SSL verification *by default*! This needs to be
  104|       |   * switched off unless wanted.
  105|       |   */
  106|  1.62k|  sslc->verifypeer = TRUE;
  ------------------
  |  | 1020|  1.62k|#define TRUE true
  ------------------
  107|  1.62k|  sslc->verifyhost = TRUE;
  ------------------
  |  | 1020|  1.62k|#define TRUE true
  ------------------
  108|       |  sslc->cache_session = TRUE; /* caching by default */
  ------------------
  |  | 1020|  1.62k|#define TRUE true
  ------------------
  109|  1.62k|}

LLVMFuzzerTestOneInput:
   73|    822|                                      std::size_t size) {
   74|    822|  if (size == 0 || !WriteNetrcInput(data + 1, size - 1) ||
  ------------------
  |  Branch (74:7): [True: 0, False: 822]
  |  Branch (74:20): [True: 9, False: 813]
  ------------------
   75|    813|      kInputFile.path() == nullptr) {
  ------------------
  |  Branch (75:7): [True: 0, False: 813]
  ------------------
   76|      9|    return 0;
   77|      9|  }
   78|       |
   79|    813|  ProbeErrorStringsOnce();
   80|       |
   81|    813|  CURL *easy = curl_easy_init();
   82|    813|  if (easy == nullptr) {
  ------------------
  |  Branch (82:7): [True: 0, False: 813]
  ------------------
   83|      0|    return 0;
   84|      0|  }
   85|       |
   86|       |  // Use curl's real private type so layout/API changes fail at compile time.
   87|    813|  struct store_netrc store;
   88|    813|  struct Curl_creds *creds = nullptr;
   89|    813|  Curl_netrc_init(&store);
   90|       |
   91|    813|  const char *hostname = (data[0] & 1U) != 0 ? "other.test" : "fuzz.test";
  ------------------
  |  Branch (91:26): [True: 290, False: 523]
  ------------------
   92|    813|  const char *user = (data[0] & 2U) != 0 ? "fuzz-user" : nullptr;
  ------------------
  |  Branch (92:22): [True: 354, False: 459]
  ------------------
   93|    813|  const NETRCcode result =
   94|    813|      Curl_netrc_scan(reinterpret_cast<struct Curl_easy *>(easy), &store,
   95|    813|                      hostname, user, kInputFile.path(), &creds);
   96|    813|  (void)Curl_netrc_strerror(result);
   97|       |
   98|    813|  Curl_creds_unlink(&creds);
   99|    813|  Curl_netrc_cleanup(&store);
  100|    813|  curl_easy_cleanup(easy);
  101|    813|  return 0;
  102|    813|}
fuzz_netrc.cc:_ZN12_GLOBAL__N_113CurlBootstrapC2Ev:
   32|      2|  CurlBootstrap() { (void)curl_global_init(CURL_GLOBAL_ALL); }
  ------------------
  |  | 3047|      2|#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3044|      2|#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
  |  |  ------------------
  |  |               #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3045|      2|#define CURL_GLOBAL_WINSOCK (1 << 1)
  |  |  ------------------
  ------------------
fuzz_netrc.cc:_ZN12_GLOBAL__N_115WriteNetrcInputEPKhm:
   46|    822|bool WriteNetrcInput(const std::uint8_t *data, std::size_t size) {
   47|    822|  if (size > kMaxNetrcBytes) {
  ------------------
  |  Branch (47:7): [True: 9, False: 813]
  ------------------
   48|      9|    return false;
   49|      9|  }
   50|       |
   51|    813|  std::string file_contents(1, '\n');
   52|    813|  if (size != 0) {
  ------------------
  |  Branch (52:7): [True: 810, False: 3]
  ------------------
   53|    810|    file_contents.append(reinterpret_cast<const char *>(data), size);
   54|    810|  }
   55|    813|  return kInputFile.Write(
   56|    813|      reinterpret_cast<const std::uint8_t *>(file_contents.data()),
   57|    813|      file_contents.size());
   58|    822|}
fuzz_netrc.cc:_ZN12_GLOBAL__N_121ProbeErrorStringsOnceEv:
   60|    813|void ProbeErrorStringsOnce() {
   61|    813|  static const bool probed = [] {
   62|    813|    for (int value = 0; value < static_cast<int>(NETRC_LAST); ++value) {
   63|    813|      (void)Curl_netrc_strerror(static_cast<NETRCcode>(value));
   64|    813|    }
   65|    813|    return true;
   66|    813|  }();
   67|    813|  (void)probed;
   68|    813|}
fuzz_netrc.cc:_ZZN12_GLOBAL__N_121ProbeErrorStringsOnceEvENK3$_0clEv:
   61|      1|  static const bool probed = [] {
   62|      6|    for (int value = 0; value < static_cast<int>(NETRC_LAST); ++value) {
  ------------------
  |  Branch (62:25): [True: 5, False: 1]
  ------------------
   63|      5|      (void)Curl_netrc_strerror(static_cast<NETRCcode>(value));
   64|      5|    }
   65|      1|    return true;
   66|      1|  }();

_ZN12proto_fuzzer25BoundedAnonymousInputFileC2Em:
   24|      2|    : max_bytes_(max_bytes), file_(nullptr), ready_(false) {}
_ZN12proto_fuzzer25BoundedAnonymousInputFile10EnsureOpenEv:
   35|    813|bool BoundedAnonymousInputFile::EnsureOpen() {
   36|    813|  if (file_ != nullptr) {
  ------------------
  |  Branch (36:7): [True: 812, False: 1]
  ------------------
   37|    812|    return true;
   38|    812|  }
   39|       |
   40|      1|  file_ = std::tmpfile();
   41|      1|  if (file_ == nullptr) {
  ------------------
  |  Branch (41:7): [True: 0, False: 1]
  ------------------
   42|      0|    return false;
   43|      0|  }
   44|      1|  const int fd = fileno(file_);
   45|      1|  if (fd < 0) {
  ------------------
  |  Branch (45:7): [True: 0, False: 1]
  ------------------
   46|      0|    std::fclose(file_);
   47|      0|    file_ = nullptr;
   48|      0|    return false;
   49|      0|  }
   50|      1|  path_ = "/proc/self/fd/" + std::to_string(fd);
   51|      1|  return true;
   52|      1|}
_ZN12proto_fuzzer25BoundedAnonymousInputFile5WriteEPKhm:
   60|    813|bool BoundedAnonymousInputFile::Write(const std::uint8_t* data, std::size_t size) {
   61|    813|  ready_ = false;
   62|    813|  if (size > max_bytes_ || (data == nullptr && size != 0) || !EnsureOpen()) {
  ------------------
  |  Branch (62:7): [True: 0, False: 813]
  |  Branch (62:29): [True: 0, False: 813]
  |  Branch (62:48): [True: 0, False: 0]
  |  Branch (62:62): [True: 0, False: 813]
  ------------------
   63|      0|    return false;
   64|      0|  }
   65|       |
   66|    813|  const int fd = fileno(file_);
   67|    813|  if (fd < 0 || ftruncate(fd, 0) != 0) {
  ------------------
  |  Branch (67:7): [True: 0, False: 813]
  |  Branch (67:17): [True: 0, False: 813]
  ------------------
   68|      0|    return false;
   69|      0|  }
   70|       |
   71|    813|  std::size_t offset = 0;
   72|  1.62k|  while (offset < size) {
  ------------------
  |  Branch (72:10): [True: 813, False: 813]
  ------------------
   73|    813|    const ssize_t written = pwrite(fd, data + offset, size - offset, static_cast<off_t>(offset));
   74|    813|    if (written < 0 && errno == EINTR) {
  ------------------
  |  Branch (74:9): [True: 0, False: 813]
  |  Branch (74:24): [True: 0, False: 0]
  ------------------
   75|      0|      continue;
   76|      0|    }
   77|    813|    if (written <= 0) {
  ------------------
  |  Branch (77:9): [True: 0, False: 813]
  ------------------
   78|      0|      return false;
   79|      0|    }
   80|    813|    offset += static_cast<std::size_t>(written);
   81|    813|  }
   82|       |
   83|    813|  ready_ = true;
   84|    813|  return true;
   85|    813|}
_ZNK12proto_fuzzer25BoundedAnonymousInputFile4pathEv:
   89|  1.62k|const char* BoundedAnonymousInputFile::path() const { return ready_ ? path_.c_str() : nullptr; }
  ------------------
  |  Branch (89:62): [True: 1.62k, False: 0]
  ------------------

