Curl_altsvc_cleanup:
  412|    792|{
  413|    792|  if(*asi) {
  ------------------
  |  Branch (413:6): [True: 0, False: 792]
  ------------------
  414|      0|    struct Curl_llist_node *e;
  415|      0|    struct Curl_llist_node *n;
  416|      0|    struct altsvcinfo *altsvc = *asi;
  417|      0|    for(e = Curl_llist_head(&altsvc->list); e; e = n) {
  ------------------
  |  Branch (417:45): [True: 0, False: 0]
  ------------------
  418|      0|      struct altsvc *as = Curl_node_elem(e);
  419|      0|      n = Curl_node_next(e);
  420|      0|      altsvc_free(as);
  ------------------
  |  |   99|      0|#define altsvc_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  421|      0|    }
  422|      0|    curlx_free(altsvc->filename);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  423|      0|    curlx_free(altsvc);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  424|       |    *asi = NULL; /* clear the pointer */
  425|      0|  }
  426|    792|}
Curl_altsvc_save:
  433|    792|{
  434|    792|  CURLcode result = CURLE_OK;
  435|    792|  FILE *out;
  436|    792|  char *tempstore = NULL;
  437|       |
  438|    792|  if(!asi)
  ------------------
  |  Branch (438:6): [True: 792, False: 0]
  ------------------
  439|       |    /* no cache activated */
  440|    792|    return CURLE_OK;
  441|       |
  442|       |  /* if not new name is given, use the one we stored from the load */
  443|      0|  if(!file && asi->filename)
  ------------------
  |  Branch (443:6): [True: 0, False: 0]
  |  Branch (443:15): [True: 0, False: 0]
  ------------------
  444|      0|    file = asi->filename;
  445|       |
  446|      0|  if((asi->flags & CURLALTSVC_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1044|      0|#define CURLALTSVC_READONLYFILE (1L << 2)
  ------------------
  |  Branch (446:6): [True: 0, False: 0]
  |  Branch (446:48): [True: 0, False: 0]
  |  Branch (446:57): [True: 0, False: 0]
  ------------------
  447|       |    /* marked as read-only, no file or zero length filename */
  448|      0|    return CURLE_OK;
  449|       |
  450|      0|  result = Curl_fopen(data, file, &out, &tempstore);
  451|      0|  if(!result) {
  ------------------
  |  Branch (451:6): [True: 0, False: 0]
  ------------------
  452|      0|    struct Curl_llist_node *e;
  453|      0|    struct Curl_llist_node *n;
  454|      0|    fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n"
  455|      0|          "# This file was generated by libcurl! Edit at your own risk.\n",
  456|      0|          out);
  457|      0|    for(e = Curl_llist_head(&asi->list); e; e = n) {
  ------------------
  |  Branch (457:42): [True: 0, False: 0]
  ------------------
  458|      0|      struct altsvc *as = Curl_node_elem(e);
  459|      0|      n = Curl_node_next(e);
  460|      0|      result = altsvc_out(as, out);
  461|      0|      if(result)
  ------------------
  |  Branch (461:10): [True: 0, False: 0]
  ------------------
  462|      0|        break;
  463|      0|    }
  464|      0|    if(fflush(out) || ferror(out))
  ------------------
  |  Branch (464:8): [True: 0, False: 0]
  |  Branch (464:23): [True: 0, False: 0]
  ------------------
  465|      0|      result = CURLE_WRITE_ERROR;
  466|      0|    if(curlx_fclose(out))
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  |  |  ------------------
  |  |  |  Branch (88:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  467|      0|      result = CURLE_WRITE_ERROR;
  468|      0|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   74|      0|#define curlx_rename            rename
  ------------------
  |  Branch (468:8): [True: 0, False: 0]
  |  Branch (468:19): [True: 0, False: 0]
  |  Branch (468:32): [True: 0, False: 0]
  ------------------
  469|      0|      result = CURLE_WRITE_ERROR;
  470|       |
  471|      0|    if(result && tempstore)
  ------------------
  |  Branch (471:8): [True: 0, False: 0]
  |  Branch (471:18): [True: 0, False: 0]
  ------------------
  472|      0|      unlink(tempstore);
  473|      0|  }
  474|      0|  curlx_free(tempstore);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  475|      0|  return result;
  476|      0|}

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

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

Curl_flush_cookies:
 1826|    792|{
 1827|    792|  Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1828|       |  /* only save the cookie file if a transfer was started (cookies->running is
 1829|       |     set), as otherwise the cookies were not completely initialized and there
 1830|       |     might be cookie files that were not loaded so saving the file is the
 1831|       |     wrong thing. */
 1832|    792|  if(data->cookies) {
  ------------------
  |  Branch (1832:6): [True: 0, False: 792]
  ------------------
 1833|      0|    const char *cookiejar = CURL_EASY_STR(data, STRING_COOKIEJAR);
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1834|      0|    if(cookiejar && data->cookies->running) {
  ------------------
  |  Branch (1834:8): [True: 0, False: 0]
  |  Branch (1834:21): [True: 0, False: 0]
  ------------------
 1835|       |      /* if we have a destination file for all the cookies to get dumped to */
 1836|      0|      CURLcode result = cookie_output(data, data->cookies, cookiejar);
 1837|      0|      if(result)
  ------------------
  |  Branch (1837:10): [True: 0, False: 0]
  ------------------
 1838|      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]
  |  |  ------------------
  ------------------
 1839|      0|              cookiejar, curl_easy_strerror(result));
 1840|      0|    }
 1841|       |
 1842|      0|    if(cleanup && (!data->share || (data->cookies != data->share->cookies))) {
  ------------------
  |  Branch (1842:8): [True: 0, False: 0]
  |  Branch (1842:20): [True: 0, False: 0]
  |  Branch (1842:36): [True: 0, False: 0]
  ------------------
 1843|      0|      Curl_cookie_cleanup(data->cookies);
 1844|       |      data->cookies = NULL;
 1845|      0|    }
 1846|      0|  }
 1847|    792|  Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1848|    792|}

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

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

Curl_share_lock_share:
  345|    792|{
  346|    792|  if(!GOOD_SHARE_HANDLE(share))
  ------------------
  |  |   39|    792|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   38|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (39:31): [True: 0, False: 792]
  |  |  |  Branch (39:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  347|    792|    return CURLSHE_INVALID;
  348|       |
  349|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (349:6): [True: 0, False: 0]
  ------------------
  350|      0|     share->lockfunc) /* only call this if set! */
  ------------------
  |  Branch (350:6): [True: 0, False: 0]
  ------------------
  351|      0|    share->lockfunc(data, type, accesstype, share->clientdata);
  352|       |  /* else if we do not share this, pretend successful lock */
  353|       |
  354|      0|  return CURLSHE_OK;
  355|    792|}
Curl_share_lock:
  359|    792|{
  360|    792|  return Curl_share_lock_share(data->share, data, type, accesstype);
  361|    792|}
Curl_share_unlock_share:
  366|    792|{
  367|    792|  if(!GOOD_SHARE_HANDLE(share))
  ------------------
  |  |   39|    792|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   38|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (39:31): [True: 0, False: 792]
  |  |  |  Branch (39:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  368|    792|    return CURLSHE_INVALID;
  369|       |
  370|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (370:6): [True: 0, False: 0]
  ------------------
  371|      0|     share->unlockfunc) /* only call this if set! */
  ------------------
  |  Branch (371:6): [True: 0, False: 0]
  ------------------
  372|      0|    share->unlockfunc(data, type, share->clientdata);
  373|       |
  374|      0|  return CURLSHE_OK;
  375|    792|}
Curl_share_unlock:
  378|    792|{
  379|    792|  return Curl_share_unlock_share(data->share, data, type);
  380|    792|}
Curl_share_easy_unlink:
  383|    792|{
  384|    792|  struct Curl_share *share = data->share;
  385|       |
  386|    792|  if(share) {
  ------------------
  |  Branch (386:6): [True: 0, False: 792]
  ------------------
  387|      0|    bool locked;
  388|       |
  389|      0|    if(!GOOD_SHARE_HANDLE(share))
  ------------------
  |  |   39|      0|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   38|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (39:31): [True: 0, False: 0]
  |  |  |  Branch (39:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  390|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  391|       |
  392|      0|    locked = share_lock_acquire(share, data);
  393|       |    /* If share caches connections, detach any existing connection and
  394|       |     * forget its identifier. */
  395|      0|    if((share->specifier & (1 << CURL_LOCK_DATA_CONNECT))) {
  ------------------
  |  Branch (395:8): [True: 0, False: 0]
  ------------------
  396|      0|      if(data->conn)
  ------------------
  |  Branch (396:10): [True: 0, False: 0]
  ------------------
  397|      0|        Curl_detach_connection(data);
  398|      0|      data->state.last_conn_id = -1;
  399|      0|      data->state.last_cpid = UINT32_MAX;
  400|      0|    }
  401|       |
  402|      0|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
  403|      0|    if(share->cookies == data->cookies)
  ------------------
  |  Branch (403:8): [True: 0, False: 0]
  ------------------
  404|      0|      data->cookies = NULL;
  405|      0|#endif
  406|       |
  407|      0|#ifndef CURL_DISABLE_HSTS
  408|      0|    if(share->hsts == data->hsts)
  ------------------
  |  Branch (408:8): [True: 0, False: 0]
  ------------------
  409|      0|      data->hsts = NULL;
  410|      0|#endif
  411|       |#ifdef USE_LIBPSL
  412|       |    if(&share->psl == data->psl)
  413|       |      data->psl = data->multi ? &data->multi->psl : NULL;
  414|       |#endif
  415|       |
  416|      0|    share_lock_release(data->share, data, locked);
  417|      0|    share_unlink(&data->share);
  418|      0|  }
  419|    792|  return CURLE_OK;
  420|    792|}

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

curlx_dyn_init:
   39|  3.95k|{
   40|  3.95k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|  3.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (40:3): [True: 0, False: 3.95k]
  |  Branch (40:3): [True: 3.95k, False: 0]
  ------------------
   41|  3.95k|  DEBUGASSERT(toobig);
  ------------------
  |  | 1016|  3.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (41:3): [True: 0, False: 3.95k]
  |  Branch (41:3): [True: 3.95k, False: 0]
  ------------------
   42|  3.95k|  DEBUGASSERT(toobig <= MAX_DYNBUF_SIZE); /* catch crazy mistakes */
  ------------------
  |  | 1016|  3.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (42:3): [True: 0, False: 3.95k]
  |  Branch (42:3): [True: 3.95k, False: 0]
  ------------------
   43|  3.95k|  s->bufr = NULL;
   44|  3.95k|  s->leng = 0;
   45|  3.95k|  s->allc = 0;
   46|  3.95k|  s->toobig = toobig;
   47|  3.95k|#ifdef DEBUGBUILD
   48|  3.95k|  s->init = DYNINIT;
  ------------------
  |  |   32|  3.95k|#define DYNINIT 0xbee51da /* random pattern */
  ------------------
   49|  3.95k|#endif
   50|  3.95k|}
curlx_dyn_free:
   57|  3.97k|{
   58|  3.97k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|  3.97k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 0, False: 3.97k]
  |  Branch (58:3): [True: 3.97k, False: 0]
  ------------------
   59|  3.97k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|  3.97k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (59:3): [True: 0, False: 3.97k]
  |  Branch (59:3): [True: 3.97k, False: 0]
  ------------------
   60|  3.97k|  curlx_safefree(s->bufr);
  ------------------
  |  | 1359|  3.97k|  do {                      \
  |  | 1360|  3.97k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  3.97k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  3.97k|    (ptr) = NULL;           \
  |  | 1362|  3.97k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 3.97k]
  |  |  ------------------
  ------------------
   61|  3.97k|  s->leng = s->allc = 0;
   62|  3.97k|}
curlx_dyn_reset:
  126|   178k|{
  127|   178k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   178k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (127:3): [True: 0, False: 178k]
  |  Branch (127:3): [True: 178k, False: 0]
  ------------------
  128|   178k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   178k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (128:3): [True: 0, False: 178k]
  |  Branch (128:3): [True: 178k, False: 0]
  ------------------
  129|   178k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   178k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (129:3): [True: 178k, False: 0]
  |  Branch (129:3): [True: 0, False: 0]
  |  Branch (129:3): [True: 73.2k, False: 105k]
  |  Branch (129:3): [True: 105k, False: 0]
  ------------------
  130|   178k|  if(s->leng)
  ------------------
  |  Branch (130:6): [True: 105k, False: 73.2k]
  ------------------
  131|   105k|    s->bufr[0] = 0;
  132|   178k|  s->leng = 0;
  133|   178k|}
curlx_dyn_addn:
  163|   271k|{
  164|   271k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   271k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (164:3): [True: 0, False: 271k]
  |  Branch (164:3): [True: 271k, False: 0]
  ------------------
  165|   271k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   271k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (165:3): [True: 0, False: 271k]
  |  Branch (165:3): [True: 271k, False: 0]
  ------------------
  166|   271k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   271k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 271k, False: 0]
  |  Branch (166:3): [True: 0, False: 0]
  |  Branch (166:3): [True: 109k, False: 161k]
  |  Branch (166:3): [True: 161k, False: 0]
  ------------------
  167|   271k|  return dyn_nappend(s, mem, len);
  168|   271k|}
curlx_dyn_add:
  174|  83.7k|{
  175|  83.7k|  size_t n;
  176|  83.7k|  DEBUGASSERT(str);
  ------------------
  |  | 1016|  83.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (176:3): [True: 0, False: 83.7k]
  |  Branch (176:3): [True: 83.7k, False: 0]
  ------------------
  177|  83.7k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|  83.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (177:3): [True: 0, False: 83.7k]
  |  Branch (177:3): [True: 83.7k, False: 0]
  ------------------
  178|  83.7k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|  83.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 0, False: 83.7k]
  |  Branch (178:3): [True: 83.7k, False: 0]
  ------------------
  179|  83.7k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|  83.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 83.7k, False: 0]
  |  Branch (179:3): [True: 0, False: 0]
  |  Branch (179:3): [True: 792, False: 83.0k]
  |  Branch (179:3): [True: 83.0k, False: 0]
  ------------------
  180|  83.7k|  n = strlen(str);
  181|  83.7k|  return dyn_nappend(s, (const unsigned char *)str, n);
  182|  83.7k|}
curlx_dyn_ptr:
  238|   207k|{
  239|   207k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   207k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (239:3): [True: 0, False: 207k]
  |  Branch (239:3): [True: 207k, False: 0]
  ------------------
  240|   207k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   207k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (240:3): [True: 0, False: 207k]
  |  Branch (240:3): [True: 207k, False: 0]
  ------------------
  241|   207k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   207k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (241:3): [True: 207k, False: 0]
  |  Branch (241:3): [True: 0, False: 0]
  |  Branch (241:3): [True: 2.96k, False: 204k]
  |  Branch (241:3): [True: 204k, False: 0]
  ------------------
  242|   207k|  return s->bufr;
  243|   207k|}
curlx_dyn_len:
  272|   101k|{
  273|   101k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   101k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 101k]
  |  Branch (273:3): [True: 101k, False: 0]
  ------------------
  274|   101k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   101k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (274:3): [True: 0, False: 101k]
  |  Branch (274:3): [True: 101k, False: 0]
  ------------------
  275|   101k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   101k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (275:3): [True: 101k, False: 0]
  |  Branch (275:3): [True: 0, False: 0]
  |  Branch (275:3): [True: 540, False: 100k]
  |  Branch (275:3): [True: 100k, False: 0]
  ------------------
  276|   101k|  return s->leng;
  277|   101k|}
dynbuf.c:dyn_nappend:
   69|   355k|{
   70|   355k|  size_t idx = s->leng;
   71|   355k|  size_t a = s->allc;
   72|   355k|  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|   355k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   355k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (75:3): [True: 0, False: 355k]
  |  Branch (75:3): [True: 355k, False: 0]
  ------------------
   76|   355k|  DEBUGASSERT(s->toobig);
  ------------------
  |  | 1016|   355k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 355k]
  |  Branch (76:3): [True: 355k, False: 0]
  ------------------
   77|   355k|  DEBUGASSERT(idx < s->toobig);
  ------------------
  |  | 1016|   355k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 355k]
  |  Branch (77:3): [True: 355k, False: 0]
  ------------------
   78|   355k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   355k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (78:3): [True: 355k, False: 0]
  |  Branch (78:3): [True: 0, False: 0]
  |  Branch (78:3): [True: 110k, False: 244k]
  |  Branch (78:3): [True: 244k, False: 0]
  ------------------
   79|   355k|  DEBUGASSERT(a <= s->toobig);
  ------------------
  |  | 1016|   355k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (79:3): [True: 0, False: 355k]
  |  Branch (79:3): [True: 355k, False: 0]
  ------------------
   80|   355k|  DEBUGASSERT(!len || mem);
  ------------------
  |  | 1016|   355k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (80:3): [True: 355k, False: 0]
  |  Branch (80:3): [True: 0, False: 0]
  |  Branch (80:3): [True: 5.05k, False: 350k]
  |  Branch (80:3): [True: 350k, False: 0]
  ------------------
   81|       |
   82|   355k|  if(fit > s->toobig) {
  ------------------
  |  Branch (82:6): [True: 18, False: 355k]
  ------------------
   83|     18|    curlx_dyn_free(s);
   84|     18|    return CURLE_TOO_LARGE;
   85|     18|  }
   86|   355k|  else if(!a) {
  ------------------
  |  Branch (86:11): [True: 2.00k, False: 353k]
  ------------------
   87|  2.00k|    DEBUGASSERT(!idx);
  ------------------
  |  | 1016|  2.00k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:5): [True: 0, False: 2.00k]
  |  Branch (87:5): [True: 2.00k, False: 0]
  ------------------
   88|       |    /* first invoke */
   89|  2.00k|    if(MIN_FIRST_ALLOC > s->toobig)
  ------------------
  |  |   29|  2.00k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (89:8): [True: 0, False: 2.00k]
  ------------------
   90|      0|      a = s->toobig;
   91|  2.00k|    else if(fit < MIN_FIRST_ALLOC)
  ------------------
  |  |   29|  2.00k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (91:13): [True: 1.91k, False: 92]
  ------------------
   92|  1.91k|      a = MIN_FIRST_ALLOC;
  ------------------
  |  |   29|  1.91k|#define MIN_FIRST_ALLOC 32
  ------------------
   93|     92|    else
   94|     92|      a = fit;
   95|  2.00k|  }
   96|   353k|  else {
   97|   356k|    while(a < fit)
  ------------------
  |  Branch (97:11): [True: 3.70k, False: 353k]
  ------------------
   98|  3.70k|      a *= 2;
   99|   353k|    if(a > s->toobig)
  ------------------
  |  Branch (99:8): [True: 17, False: 353k]
  ------------------
  100|       |      /* no point in allocating a larger buffer than this is allowed to use */
  101|     17|      a = s->toobig;
  102|   353k|  }
  103|       |
  104|   355k|  if(a != s->allc) {
  ------------------
  |  Branch (104:6): [True: 4.30k, False: 350k]
  ------------------
  105|  4.30k|    void *p = curlx_realloc(s->bufr, a);
  ------------------
  |  | 1502|  4.30k|  curl_dbg_realloc(ptr, size, __LINE__, __FILE__)
  ------------------
  106|  4.30k|    if(!p) {
  ------------------
  |  Branch (106:8): [True: 0, False: 4.30k]
  ------------------
  107|      0|      curlx_dyn_free(s);
  108|      0|      return CURLE_OUT_OF_MEMORY;
  109|      0|    }
  110|  4.30k|    s->bufr = p;
  111|  4.30k|    s->allc = a;
  112|  4.30k|  }
  113|       |
  114|   355k|  if(len)
  ------------------
  |  Branch (114:6): [True: 350k, False: 5.05k]
  ------------------
  115|   350k|    memcpy(&s->bufr[idx], mem, len);
  116|   355k|  s->leng = idx + len;
  117|   355k|  s->bufr[s->leng] = 0;
  118|   355k|  return CURLE_OK;
  119|   355k|}

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

curlx_str_passblanks:
  326|   212k|{
  327|   283k|  while(ISBLANK(**linep))
  ------------------
  |  |   43|   283k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 60.8k, False: 223k]
  |  |  |  Branch (43:38): [True: 10.1k, False: 212k]
  |  |  ------------------
  ------------------
  328|  71.0k|    (*linep)++; /* move over it */
  329|   212k|}

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

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);
  ------------------
  |  |  986|      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|    792|{
  370|    792|  CURLcode result;
  371|    792|  struct Curl_easy *data;
  372|       |
  373|       |  /* Make sure we inited the global SSL stuff */
  374|    792|  global_init_lock();
  ------------------
  |  |   92|    792|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  375|       |
  376|    792|  if(!initialized) {
  ------------------
  |  Branch (376:6): [True: 0, False: 792]
  ------------------
  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);
  ------------------
  |  |  986|      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"));
  ------------------
  |  | 1002|      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|    792|  global_init_unlock();
  ------------------
  |  |   93|    792|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  386|       |
  387|       |  /* We use Curl_open() with undefined URL so far */
  388|    792|  result = Curl_open(&data);
  389|    792|  if(result) {
  ------------------
  |  Branch (389:6): [True: 0, False: 792]
  ------------------
  390|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_open failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  391|      0|    return NULL;
  392|      0|  }
  393|       |
  394|    792|  return data;
  395|    792|}
curl_easy_cleanup:
  884|    792|{
  885|    792|  struct Curl_eapi_guard guard;
  886|       |
  887|    792|  if(CURL_EAPI_ENTER(&guard, curl, easy_cleanup, NULL)) {
  ------------------
  |  |  163|    792|  Curl_eapi_enter(g, curl, CURL_EAPI_FN_##fn, r) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 792, False: 0]
  |  |  |  Branch (163:53): [True: 792, False: 0]
  |  |  ------------------
  ------------------
  888|    792|    struct Curl_easy *data = curl;
  889|    792|    struct Curl_sigpipe_ctx sigpipe_ctx;
  890|    792|    sigpipe_ignore(data, &sigpipe_ctx);
  891|    792|    Curl_close(&data);
  892|    792|    sigpipe_restore(&sigpipe_ctx);
  893|    792|  }
  894|    792|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|    792|  Curl_eapi_leave(g)
  ------------------
  895|    792|}
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;
  ------------------
  |  | 1492|      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"));
  ------------------
  |  | 1002|      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"));
  ------------------
  |  | 1002|      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"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  182|      0|    goto fail;
  183|      0|  }
  184|       |
  185|      2|  if(!Curl_vquic_init()) {
  ------------------
  |  |   82|      2|#define Curl_vquic_init() 1
  ------------------
  |  Branch (185:6): [Folded, False: 2]
  ------------------
  186|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_vquic_init failed\n"));
  ------------------
  |  | 1002|      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"));
  ------------------
  |  | 1002|      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"));
  ------------------
  |  | 1002|      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"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  202|      0|    goto fail;
  203|      0|  }
  204|       |
  205|      2|  if(Curl_ssh_init()) {
  ------------------
  |  |  264|      2|#define Curl_ssh_init() 0
  |  |  ------------------
  |  |  |  Branch (264:25): [Folded, False: 2]
  |  |  ------------------
  ------------------
  206|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssh_init failed\n"));
  ------------------
  |  | 1002|      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);
  ------------------
  |  | 1498|      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|    794|{
   65|    794|  for(;;) {
   66|    794|    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
  ------------------
  |  Branch (66:8): [True: 794, False: 0]
  ------------------
   67|    794|      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|    794|}
easy.c:curl_simple_lock_unlock:
   84|    794|{
   85|    794|  atomic_store_explicit(lock, false, memory_order_release);
   86|    794|}

Curl_frzn_strs_safefree:
   34|  7.12k|{
   35|       |  curlx_safefree(*pfstrs);
  ------------------
  |  | 1359|  7.12k|  do {                      \
  |  | 1360|  7.12k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  7.12k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  7.12k|    (ptr) = NULL;           \
  |  | 1362|  7.12k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 7.12k]
  |  |  ------------------
  ------------------
   36|  7.12k|}

Curl_wildcard_dtor:
  191|    792|{
  192|    792|  struct WildcardData *wc = *wcp;
  193|    792|  if(!wc)
  ------------------
  |  Branch (193:6): [True: 792, False: 0]
  ------------------
  194|    792|    return;
  195|       |
  196|      0|  if(wc->dtor) {
  ------------------
  |  Branch (196:6): [True: 0, False: 0]
  ------------------
  197|      0|    wc->dtor(wc->ftpwc);
  198|      0|    wc->dtor = ZERO_NULL;
  ------------------
  |  | 1174|      0|#define ZERO_NULL 0
  ------------------
  199|      0|    wc->ftpwc = NULL;
  200|      0|  }
  201|      0|  DEBUGASSERT(!wc->ftpwc);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 0]
  |  Branch (201:3): [True: 0, False: 0]
  ------------------
  202|       |
  203|      0|  Curl_llist_destroy(&wc->filelist, NULL);
  204|      0|  curlx_safefree(wc->path);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  205|      0|  curlx_safefree(wc->pattern);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  206|      0|  wc->state = CURLWC_INIT;
  207|      0|  curlx_free(wc);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  208|       |  *wcp = NULL;
  209|      0|}

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

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,
  ------------------
  |  |  989|      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;
  ------------------
  |  |  986|      2|#define TRUE true
  ------------------
   83|      2|  return CURLE_OK;
   84|      2|}
Curl_hash_init:
  257|    792|{
  258|    792|  DEBUGASSERT(h);
  ------------------
  |  | 1016|    792|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (258:3): [True: 0, False: 792]
  |  Branch (258:3): [True: 792, False: 0]
  ------------------
  259|    792|  DEBUGASSERT(slots);
  ------------------
  |  | 1016|    792|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (259:3): [True: 0, False: 792]
  |  Branch (259:3): [True: 792, False: 0]
  ------------------
  260|    792|  DEBUGASSERT((unsigned int)type < CURL_HASH_TYPE_LAST);
  ------------------
  |  | 1016|    792|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (260:3): [True: 0, False: 792]
  |  Branch (260:3): [True: 792, False: 0]
  ------------------
  261|    792|  DEBUGASSERT(dtor);
  ------------------
  |  | 1016|    792|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (261:3): [True: 0, False: 792]
  |  Branch (261:3): [True: 792, False: 0]
  ------------------
  262|       |
  263|    792|  h->table = NULL;
  264|    792|  h->dtor = dtor;
  265|    792|  h->size = 0;
  266|    792|  h->slots = slots;
  267|    792|  h->type = (uint8_t)type;
  268|    792|#ifdef DEBUGBUILD
  269|    792|  h->init = HASHINIT;
  ------------------
  |  |   33|    792|#define HASHINIT 0x7017e781
  ------------------
  270|    792|#endif
  271|    792|}
Curl_hash_destroy:
  450|    792|{
  451|    792|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1016|    792|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (451:3): [True: 0, False: 792]
  |  Branch (451:3): [True: 792, False: 0]
  ------------------
  452|    792|  if(h->table) {
  ------------------
  |  Branch (452:6): [True: 0, False: 792]
  ------------------
  453|      0|    Curl_hash_clean(h);
  454|      0|    curlx_safefree(h->table);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  455|      0|  }
  456|    792|  DEBUGASSERT(h->size == 0);
  ------------------
  |  | 1016|    792|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (456:3): [True: 0, False: 792]
  |  Branch (456:3): [True: 792, False: 0]
  ------------------
  457|    792|  h->slots = 0;
  458|    792|}

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

Curl_hsts_cleanup:
   80|    792|{
   81|    792|  struct hsts *h = *hp;
   82|    792|  if(h) {
  ------------------
  |  Branch (82:6): [True: 0, False: 792]
  ------------------
   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)
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
   89|      0|    }
   90|      0|    curlx_free(h->filename);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   91|      0|    curlx_free(h);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   92|       |    *hp = NULL;
   93|      0|  }
   94|    792|}
Curl_hsts_save:
  385|    792|{
  386|    792|  struct Curl_llist_node *e;
  387|    792|  struct Curl_llist_node *n;
  388|    792|  CURLcode result = CURLE_OK;
  389|    792|  FILE *out;
  390|    792|  char *tempstore = NULL;
  391|       |
  392|    792|  if(!h)
  ------------------
  |  Branch (392:6): [True: 792, False: 0]
  ------------------
  393|       |    /* no cache activated */
  394|    792|    return CURLE_OK;
  395|       |
  396|       |  /* if no new name is given, use the one we stored from the load */
  397|      0|  if(!file && h->filename)
  ------------------
  |  Branch (397:6): [True: 0, False: 0]
  |  Branch (397:15): [True: 0, False: 0]
  ------------------
  398|      0|    file = h->filename;
  399|       |
  400|      0|  if((h->flags & CURLHSTS_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1084|      0|#define CURLHSTS_READONLYFILE (1L << 1)
  ------------------
  |  Branch (400:6): [True: 0, False: 0]
  |  Branch (400:44): [True: 0, False: 0]
  |  Branch (400:53): [True: 0, False: 0]
  ------------------
  401|       |    /* marked as read-only, no file or zero length filename */
  402|      0|    goto skipsave;
  403|       |
  404|      0|  result = Curl_fopen(data, file, &out, &tempstore);
  405|      0|  if(!result) {
  ------------------
  |  Branch (405:6): [True: 0, False: 0]
  ------------------
  406|      0|    fputs("# Your HSTS cache. https://curl.se/docs/hsts.html\n"
  407|      0|          "# This file was generated by libcurl! Edit at your own risk.\n",
  408|      0|          out);
  409|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (409:40): [True: 0, False: 0]
  ------------------
  410|      0|      struct stsentry *sts = Curl_node_elem(e);
  411|      0|      n = Curl_node_next(e);
  412|      0|      hsts_out(sts, out);
  413|      0|    }
  414|      0|    if(fflush(out) || ferror(out))
  ------------------
  |  Branch (414:8): [True: 0, False: 0]
  |  Branch (414:23): [True: 0, False: 0]
  ------------------
  415|      0|      result = CURLE_WRITE_ERROR;
  416|      0|    if(curlx_fclose(out))
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  |  |  ------------------
  |  |  |  Branch (88:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  417|      0|      result = CURLE_WRITE_ERROR;
  418|      0|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   74|      0|#define curlx_rename            rename
  ------------------
  |  Branch (418:8): [True: 0, False: 0]
  |  Branch (418:19): [True: 0, False: 0]
  |  Branch (418:32): [True: 0, False: 0]
  ------------------
  419|      0|      result = CURLE_WRITE_ERROR;
  420|       |
  421|      0|    if(result && tempstore)
  ------------------
  |  Branch (421:8): [True: 0, False: 0]
  |  Branch (421:18): [True: 0, False: 0]
  ------------------
  422|      0|      unlink(tempstore);
  423|      0|  }
  424|      0|  curlx_free(tempstore);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  425|      0|skipsave:
  426|      0|  if(data->set.hsts_write) {
  ------------------
  |  Branch (426:6): [True: 0, False: 0]
  ------------------
  427|       |    /* if there is a write callback */
  428|      0|    struct curl_index i; /* count */
  429|      0|    i.total = Curl_llist_count(&h->list);
  430|      0|    i.index = 0;
  431|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (431:40): [True: 0, False: 0]
  ------------------
  432|      0|      struct stsentry *sts = Curl_node_elem(e);
  433|      0|      bool stop;
  434|      0|      n = Curl_node_next(e);
  435|      0|      result = hsts_push(data, &i, sts, &stop);
  436|      0|      if(result || stop)
  ------------------
  |  Branch (436:10): [True: 0, False: 0]
  |  Branch (436:20): [True: 0, False: 0]
  ------------------
  437|      0|        break;
  438|      0|      i.index++;
  439|      0|    }
  440|      0|  }
  441|      0|  return result;
  442|      0|}

Curl_http_auth_cleanup_digest:
  174|    792|{
  175|    792|  Curl_auth_digest_cleanup(&data->state.digest);
  176|    792|  Curl_auth_digest_cleanup(&data->state.proxydigest);
  177|    792|}

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

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

Curl_mime_cleanpart:
 1086|  1.58k|{
 1087|  1.58k|  if(part) {
  ------------------
  |  Branch (1087:6): [True: 0, False: 1.58k]
  ------------------
 1088|      0|    cleanup_part_content(part);
 1089|      0|    curl_slist_free_all(part->curlheaders);
 1090|      0|    if(part->flags & MIME_USERHEADERS_OWNER)
  ------------------
  |  |   34|      0|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
  |  Branch (1090:8): [True: 0, False: 0]
  ------------------
 1091|      0|      curl_slist_free_all(part->userheaders);
 1092|      0|    curlx_safefree(part->mimetype);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1093|      0|    curlx_safefree(part->name);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1094|       |    curlx_safefree(part->filename);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1095|      0|    Curl_mime_initpart(part);
 1096|      0|  }
 1097|  1.58k|}

Curl_detach_connection:
  923|    792|{
  924|    792|  struct connectdata *conn = data->conn;
  925|    792|  if(conn) {
  ------------------
  |  Branch (925:6): [True: 0, False: 792]
  ------------------
  926|       |    /* this should never happen, prevent underflow */
  927|      0|    DEBUGASSERT(conn->attached_xfers);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (927:5): [True: 0, False: 0]
  |  Branch (927:5): [True: 0, False: 0]
  ------------------
  928|      0|    if(conn->attached_xfers) {
  ------------------
  |  Branch (928:8): [True: 0, False: 0]
  ------------------
  929|      0|      conn->attached_xfers--;
  930|      0|      if(!conn->attached_xfers)
  ------------------
  |  Branch (930:10): [True: 0, False: 0]
  ------------------
  931|      0|        conn->attached_multi = NULL;
  932|      0|    }
  933|      0|  }
  934|    792|  data->conn = NULL;
  935|    792|}
Curl_expire_clear_all:
 3914|    792|{
 3915|    792|  struct Curl_multi *multi = data->multi;
 3916|       |
 3917|       |  /* this is only interesting while there is still an associated multi struct
 3918|       |     remaining! */
 3919|    792|  if(!multi)
  ------------------
  |  Branch (3919:6): [True: 792, False: 0]
  ------------------
 3920|    792|    return;
 3921|       |
 3922|      0|  if(Curl_timeouts_remove(&multi->timeouts, data)) {
  ------------------
  |  Branch (3922:6): [True: 0, False: 0]
  ------------------
 3923|       |    /* Since this is an cleared time, we must remove the previous entry from
 3924|       |       the splay tree */
 3925|      0|    multi_timeouts_init(data);
 3926|       |
 3927|      0|    if(data->id >= 0)
  ------------------
  |  Branch (3927:8): [True: 0, False: 0]
  ------------------
 3928|      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]
  |  |  ------------------
  ------------------
 3929|      0|  }
 3930|      0|}

Curl_netrc_scan:
  585|    792|{
  586|    792|  NETRCcode retcode = NETRC_OK;
  587|       |
  588|    792|  CURL_TRC_M(data, "[NETRC] scanning '%s' for host '%s' user '%s'",
  ------------------
  |  |  148|    792|  do {                                   \
  |  |  149|    792|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|    792|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|    792|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  1.58k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 792, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 792]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  1.58k|   (!(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|    792|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    792|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|    792|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 792]
  |  |  ------------------
  ------------------
  589|    792|             netrcfile, hostname, user);
  590|    792|  Curl_creds_unlink(pcreds);
  591|    792|  if(!netrcfile) {
  ------------------
  |  Branch (591:6): [True: 0, False: 792]
  ------------------
  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);
  ------------------
  |  |  624|      0|#  define DIR_CHAR      "/"
  ------------------
  634|      0|      if(!filealloc) {
  ------------------
  |  Branch (634:10): [True: 0, False: 0]
  ------------------
  635|      0|        curlx_free(homea);
  ------------------
  |  | 1503|      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);
  ------------------
  |  | 1503|      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);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  657|      0|  }
  658|    792|  else
  659|    792|    retcode = netrc_scan_file(
  660|    792|      data, store, hostname, user, netrcfile, pcreds);
  661|       |
  662|    792|out:
  663|    792|  if(retcode)
  ------------------
  |  Branch (663:6): [True: 694, False: 98]
  ------------------
  664|    694|    Curl_creds_unlink(pcreds);
  665|    792|  return retcode;
  666|    792|}
Curl_netrc_init:
  669|  1.58k|{
  670|  1.58k|  curlx_dyn_init(&store->filebuf, MAX_NETRC_FILE);
  ------------------
  |  |   77|  1.58k|#define MAX_NETRC_FILE  (128 * 1024)
  ------------------
  671|  1.58k|  store->loaded = FALSE;
  ------------------
  |  |  989|  1.58k|#define FALSE false
  ------------------
  672|       |  store->filename = NULL;
  673|  1.58k|}
Curl_netrc_cleanup:
  675|  1.58k|{
  676|  1.58k|  curlx_dyn_free(&store->filebuf);
  677|  1.58k|  curlx_safefree(store->filename);
  ------------------
  |  | 1359|  1.58k|  do {                      \
  |  | 1360|  1.58k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.58k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.58k|    (ptr) = NULL;           \
  |  | 1362|  1.58k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
  678|       |  store->loaded = FALSE;
  ------------------
  |  |  989|  1.58k|#define FALSE false
  ------------------
  679|  1.58k|}
Curl_netrc_strerror:
  682|    797|{
  683|    797|  switch(ret) {
  684|     99|  default:
  ------------------
  |  Branch (684:3): [True: 99, False: 698]
  ------------------
  685|     99|    return ""; /* not a legit error */
  686|      1|  case NETRC_FILE_MISSING:
  ------------------
  |  Branch (686:3): [True: 1, False: 796]
  ------------------
  687|      1|    return "no such file";
  688|    549|  case NETRC_NO_MATCH:
  ------------------
  |  Branch (688:3): [True: 549, False: 248]
  ------------------
  689|    549|    return "no matching entry";
  690|      1|  case NETRC_OUT_OF_MEMORY:
  ------------------
  |  Branch (690:3): [True: 1, False: 796]
  ------------------
  691|      1|    return "out of memory";
  692|    147|  case NETRC_SYNTAX_ERROR:
  ------------------
  |  Branch (692:3): [True: 147, False: 650]
  ------------------
  693|    147|    return "syntax error";
  694|    797|  }
  695|       |  /* never reached */
  696|    797|}
netrc.c:netrc_scan_file:
  548|    792|{
  549|    792|  struct dynbuf *filebuf = &store->filebuf;
  550|       |
  551|    792|  if(!store->loaded || strcmp(netrcfile, store->filename)) {
  ------------------
  |  Branch (551:6): [True: 792, False: 0]
  |  Branch (551:24): [True: 0, False: 0]
  ------------------
  552|    792|    NETRCcode ret;
  553|    792|    store->loaded = FALSE;
  ------------------
  |  |  989|    792|#define FALSE false
  ------------------
  554|    792|    ret = file2memory(netrcfile, filebuf);
  555|    792|    if(ret) {
  ------------------
  |  Branch (555:8): [True: 3, False: 789]
  ------------------
  556|      3|      CURL_TRC_M(data, "[NETRC] could not load '%s'", netrcfile);
  ------------------
  |  |  148|      3|  do {                                   \
  |  |  149|      3|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      3|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      3|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      6|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      6|   (!(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|      3|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      3|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      3|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3]
  |  |  ------------------
  ------------------
  557|      3|      return ret;
  558|      3|    }
  559|    789|    curlx_free(store->filename);
  ------------------
  |  | 1503|    789|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  560|    789|    store->filename = curlx_strdup(netrcfile);
  ------------------
  |  | 1497|    789|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  561|    789|    if(!store->filename) {
  ------------------
  |  Branch (561:8): [True: 0, False: 789]
  ------------------
  562|      0|      curlx_dyn_reset(&store->filebuf);
  563|      0|      return NETRC_OUT_OF_MEMORY;
  564|      0|    }
  565|    789|    store->loaded = TRUE;
  ------------------
  |  |  986|    789|#define TRUE true
  ------------------
  566|    789|  }
  567|    789|  if(!curlx_dyn_len(filebuf))
  ------------------
  |  Branch (567:6): [True: 0, False: 789]
  ------------------
  568|      0|    return NETRC_NO_MATCH;
  569|       |
  570|    789|  return netrc_scan(data, curlx_dyn_ptr(filebuf), hostname, user, pcreds);
  571|    789|}
netrc.c:file2memory:
  504|    792|{
  505|    792|  NETRCcode ret = NETRC_FILE_MISSING; /* if it cannot open the file */
  506|    792|  FILE *file = curlx_fopen(filename, FOPEN_READTEXT);
  ------------------
  |  |   83|    792|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  507|       |
  508|    792|  curlx_dyn_reset(filebuf);
  509|    792|  if(file) {
  ------------------
  |  Branch (509:6): [True: 792, False: 0]
  ------------------
  510|    792|    curlx_struct_stat stat;
  ------------------
  |  |   67|    792|#define curlx_struct_stat       struct stat
  ------------------
  511|    792|    if((curlx_fstat(fileno(file), &stat) == -1) || !S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   66|    792|#define curlx_fstat             fstat
  ------------------
  |  Branch (511:8): [True: 0, False: 792]
  |  Branch (511:52): [True: 792, False: 0]
  ------------------
  512|    792|      CURLcode result = CURLE_OK;
  513|    792|      bool eof;
  514|    792|      struct dynbuf linebuf;
  515|    792|      curlx_dyn_init(&linebuf, MAX_NETRC_LINE);
  ------------------
  |  |   76|    792|#define MAX_NETRC_LINE  16384
  ------------------
  516|    792|      ret = NETRC_OK;
  517|  83.9k|      do {
  518|  83.9k|        const char *line;
  519|       |        /* Curl_get_line always returns lines ending with a newline */
  520|  83.9k|        result = Curl_get_line(&linebuf, file, &eof);
  521|  83.9k|        if(!result) {
  ------------------
  |  Branch (521:12): [True: 83.9k, False: 2]
  ------------------
  522|  83.9k|          line = curlx_dyn_ptr(&linebuf);
  523|       |          /* skip comments on load */
  524|  83.9k|          curlx_str_passblanks(&line);
  525|  83.9k|          if(*line == '#')
  ------------------
  |  Branch (525:14): [True: 196, False: 83.7k]
  ------------------
  526|    196|            continue;
  527|  83.7k|          result = curlx_dyn_add(filebuf, line);
  528|  83.7k|        }
  529|  83.7k|        if(result) {
  ------------------
  |  Branch (529:12): [True: 3, False: 83.7k]
  ------------------
  530|      3|          curlx_dyn_free(filebuf);
  531|      3|          ret = curl2netrc(result);
  ------------------
  |  |   84|      3|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 0, False: 3]
  |  |  |  Branch (84:25): [True: 0, False: 3]
  |  |  ------------------
  |  |   85|      3|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  532|      3|          break;
  533|      3|        }
  534|  83.9k|      } while(!eof);
  ------------------
  |  Branch (534:15): [True: 83.1k, False: 789]
  ------------------
  535|    792|      curlx_dyn_free(&linebuf);
  536|    792|    }
  537|    792|    curlx_fclose(file);
  ------------------
  |  |   88|    792|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  538|    792|  }
  539|    792|  return ret;
  540|    792|}
netrc.c:netrc_scan:
  428|    789|{
  429|    789|  struct netrc_scanner sc;
  430|    789|  NETRCcode rc = NETRC_OK;
  431|       |
  432|    789|  Curl_creds_unlink(pcreds);
  433|    789|  netrc_scan_init(&sc, data, content, hostname, user);
  434|       |
  435|  69.3k|  while(!rc && !sc.found) {
  ------------------
  |  Branch (435:9): [True: 69.2k, False: 143]
  |  Branch (435:16): [True: 69.2k, False: 0]
  ------------------
  436|  69.2k|    rc = netrc_lexer_next(&sc.lexer, FALSE);
  ------------------
  |  |  989|  69.2k|#define FALSE false
  ------------------
  437|  69.2k|    if(!rc) {
  ------------------
  |  Branch (437:8): [True: 69.1k, False: 125]
  ------------------
  438|       |      /* Does this token end any previous entry? */
  439|  69.1k|      switch(sc.lexer.token) {
  440|    632|      case NETRC_TOK_EOF:
  ------------------
  |  Branch (440:7): [True: 632, False: 68.4k]
  ------------------
  441|  1.15k|      case NETRC_TOK_MACHINE:
  ------------------
  |  Branch (441:7): [True: 525, False: 68.5k]
  ------------------
  442|  10.6k|      case NETRC_TOK_DEFAULT:
  ------------------
  |  Branch (442:7): [True: 9.47k, False: 59.6k]
  ------------------
  443|  12.4k|      case NETRC_TOK_MACDEF:
  ------------------
  |  Branch (443:7): [True: 1.77k, False: 67.3k]
  ------------------
  444|  12.4k|        rc = netrc_scan_end_entry(&sc);
  445|  12.4k|        if(rc || sc.found)
  ------------------
  |  Branch (445:12): [True: 0, False: 12.4k]
  |  Branch (445:18): [True: 98, False: 12.3k]
  ------------------
  446|     98|          goto out;
  447|  12.3k|        break;
  448|  56.7k|      default:
  ------------------
  |  Branch (448:7): [True: 56.7k, False: 12.4k]
  ------------------
  449|  56.7k|        break;
  450|  69.1k|      }
  451|       |
  452|  69.0k|      switch(sc.lexer.token) {
  453|    548|      case NETRC_TOK_EOF:
  ------------------
  |  Branch (453:7): [True: 548, False: 68.4k]
  ------------------
  454|    548|        goto out;
  455|    525|      case NETRC_TOK_MACHINE:
  ------------------
  |  Branch (455:7): [True: 525, False: 68.4k]
  ------------------
  456|    525|        rc = netrc_lexer_next(&sc.lexer, TRUE);
  ------------------
  |  |  986|    525|#define TRUE true
  ------------------
  457|    525|        if(!rc) {
  ------------------
  |  Branch (457:12): [True: 524, False: 1]
  ------------------
  458|    524|          if(sc.lexer.token == NETRC_TOK_LITERAL) {
  ------------------
  |  Branch (458:14): [True: 519, False: 5]
  ------------------
  459|    519|            sc.matches_host = curl_strequal(
  460|    519|              sc.hostname, curlx_dyn_ptr(&sc.lexer.literal));
  461|    519|          }
  462|      5|          else {
  463|      5|            sc.matches_host = FALSE;
  ------------------
  |  |  989|      5|#define FALSE false
  ------------------
  464|      5|            netrc_lexer_push(&sc.lexer);
  465|      5|          }
  466|    524|        }
  467|    525|        break;
  468|  9.46k|      case NETRC_TOK_DEFAULT:
  ------------------
  |  Branch (468:7): [True: 9.46k, False: 59.5k]
  ------------------
  469|  9.46k|        sc.matches_host = TRUE;
  ------------------
  |  |  986|  9.46k|#define TRUE true
  ------------------
  470|  9.46k|        break;
  471|  1.18k|      case NETRC_TOK_ACCOUNT:
  ------------------
  |  Branch (471:7): [True: 1.18k, False: 67.8k]
  ------------------
  472|  1.18k|        rc = netrc_scan_literal(&sc, NULL); /* ignore, not used */
  473|  1.18k|        break;
  474|  16.0k|      case NETRC_TOK_LOGIN:
  ------------------
  |  Branch (474:7): [True: 16.0k, False: 52.9k]
  ------------------
  475|  16.0k|        rc = netrc_scan_literal(&sc, &sc.login);
  476|  16.0k|        break;
  477|  6.71k|      case NETRC_TOK_PASSWD:
  ------------------
  |  Branch (477:7): [True: 6.71k, False: 62.3k]
  ------------------
  478|  6.71k|        rc = netrc_scan_literal(&sc, &sc.passwd);
  479|  6.71k|        break;
  480|  1.77k|      case NETRC_TOK_MACDEF:
  ------------------
  |  Branch (480:7): [True: 1.77k, False: 67.2k]
  ------------------
  481|  1.77k|        netrc_skip_to_empty_line(&sc.lexer);
  482|  1.77k|        break;
  483|  1.42k|      case NETRC_TOK_LITERAL:
  ------------------
  |  Branch (483:7): [True: 1.42k, False: 67.5k]
  ------------------
  484|  32.7k|      case NETRC_TOK_JUNK:
  ------------------
  |  Branch (484:7): [True: 31.3k, False: 37.6k]
  ------------------
  485|  32.7k|      default:
  ------------------
  |  Branch (485:7): [True: 0, False: 69.0k]
  ------------------
  486|       |        /* skip this */
  487|  32.7k|        break;
  488|  69.0k|      }
  489|  69.0k|    }
  490|  69.2k|  }
  491|       |
  492|    789|out:
  493|    789|  if(!rc) {
  ------------------
  |  Branch (493:6): [True: 646, False: 143]
  ------------------
  494|    646|    if(sc.creds)
  ------------------
  |  Branch (494:8): [True: 98, False: 548]
  ------------------
  495|     98|      Curl_creds_link(pcreds, sc.creds);
  496|    548|    else
  497|    548|      rc = NETRC_NO_MATCH;
  498|    646|  }
  499|    789|  netrc_scan_cleanup(&sc);
  500|    789|  return rc;
  501|    789|}
netrc.c:netrc_scan_init:
  345|    789|{
  346|    789|  memset(sc, 0, sizeof(*sc));
  347|    789|  netrc_lexer_init(&sc->lexer, data, content);
  348|    789|  sc->hostname = hostname;
  349|    789|  sc->user = (user && user[0]) ? user : NULL;
  ------------------
  |  Branch (349:15): [True: 368, False: 421]
  |  Branch (349:23): [True: 368, False: 0]
  ------------------
  350|    789|  netrc_scan_reset(sc);
  351|    789|}
netrc.c:netrc_lexer_init:
  139|    789|{
  140|    789|  curlx_dyn_init(&lexer->literal, MAX_NETRC_TOKEN);
  ------------------
  |  |   78|    789|#define MAX_NETRC_TOKEN 4096
  ------------------
  141|    789|  lexer->data = data;
  142|    789|  lexer->content = lexer->pos = content;
  143|    789|}
netrc.c:netrc_scan_reset:
  334|  13.9k|{
  335|  13.9k|  curlx_safefree(sc->login);
  ------------------
  |  | 1359|  13.9k|  do {                      \
  |  | 1360|  13.9k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  13.9k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  13.9k|    (ptr) = NULL;           \
  |  | 1362|  13.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
  336|  13.9k|  curlx_safefree(sc->passwd);
  ------------------
  |  | 1359|  13.9k|  do {                      \
  |  | 1360|  13.9k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  13.9k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  13.9k|    (ptr) = NULL;           \
  |  | 1362|  13.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
  337|       |  sc->matches_host = FALSE;
  ------------------
  |  |  989|  13.9k|#define FALSE false
  ------------------
  338|  13.9k|}
netrc.c:netrc_lexer_next:
  250|  93.6k|{
  251|  93.6k|  const char *s = lexer->pos, *start;
  252|  93.6k|  NETRCcode rc = NETRC_OK;
  253|  93.6k|  size_t slen;
  254|  93.6k|  CURLcode result;
  255|       |
  256|  93.6k|  if(lexer->pushed) {
  ------------------
  |  Branch (256:6): [True: 26, False: 93.6k]
  ------------------
  257|     26|    lexer->pushed = FALSE;
  ------------------
  |  |  989|     26|#define FALSE false
  ------------------
  258|     26|    goto out;
  259|     26|  }
  260|       |
  261|  93.6k|  curlx_dyn_reset(&lexer->literal);
  262|  93.6k|  netrc_skip_blanks(lexer);
  263|  93.6k|  s = lexer->pos;
  264|       |
  265|  93.6k|  switch(*s) {
  266|    632|  case 0:
  ------------------
  |  Branch (266:3): [True: 632, False: 93.0k]
  ------------------
  267|    632|    lexer->token = NETRC_TOK_EOF;
  268|    632|    break;
  269|  1.84k|  case '\"':
  ------------------
  |  Branch (269:3): [True: 1.84k, False: 91.8k]
  ------------------
  270|  1.84k|    rc = netrc_lexer_quoted(lexer);
  271|  1.84k|    lexer->token = NETRC_TOK_LITERAL;
  272|  1.84k|    s = lexer->pos;
  273|  1.84k|    break;
  274|  91.1k|  default:
  ------------------
  |  Branch (274:3): [True: 91.1k, False: 2.47k]
  ------------------
  275|       |    /* unquoted token */
  276|  91.1k|    start = s;
  277|  2.15M|    while(*s && !ISBLANK(*s) && !ISNEWLINE(*s))
  ------------------
  |  |   43|  4.30M|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 60.1k, False: 2.09M]
  |  |  |  Branch (43:38): [True: 8.30k, False: 2.08M]
  |  |  ------------------
  ------------------
                  while(*s && !ISBLANK(*s) && !ISNEWLINE(*s))
  ------------------
  |  |   48|  2.08M|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (48:26): [True: 18.0k, False: 2.06M]
  |  |  |  Branch (48:43): [True: 4.63k, False: 2.06M]
  |  |  ------------------
  ------------------
  |  Branch (277:11): [True: 2.15M, False: 0]
  ------------------
  278|  2.06M|      ++s;
  279|  91.1k|    slen = s - start;
  280|  91.1k|    if(!slen) {
  ------------------
  |  Branch (280:8): [True: 3.33k, False: 87.8k]
  ------------------
  281|  3.33k|      rc = NETRC_SYNTAX_ERROR;
  282|  3.33k|    }
  283|  91.1k|    if(want_literal) {
  ------------------
  |  Branch (283:8): [True: 24.1k, False: 67.0k]
  ------------------
  284|  24.1k|      lexer->token = NETRC_TOK_LITERAL;
  285|  24.1k|      result = curlx_dyn_addn(&lexer->literal, start, slen);
  286|  24.1k|      rc = curl2netrc(result);
  ------------------
  |  |   84|  24.1k|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 24.0k, False: 14]
  |  |  |  Branch (84:25): [True: 0, False: 14]
  |  |  ------------------
  |  |   85|     14|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  287|  24.1k|    }
  288|  67.0k|    else if((slen == 7) && curl_strnequal(start, "machine", slen)) {
  ------------------
  |  Branch (288:13): [True: 17.5k, False: 49.5k]
  |  Branch (288:28): [True: 525, False: 17.0k]
  ------------------
  289|    525|      lexer->token = NETRC_TOK_MACHINE;
  290|    525|    }
  291|  66.5k|    else if((slen == 7) && curl_strnequal(start, "default", slen)) {
  ------------------
  |  Branch (291:13): [True: 17.0k, False: 49.5k]
  |  Branch (291:28): [True: 9.47k, False: 7.56k]
  ------------------
  292|  9.47k|      lexer->token = NETRC_TOK_DEFAULT;
  293|  9.47k|    }
  294|  57.0k|    else if((slen == 7) && curl_strnequal(start, "account", slen)) {
  ------------------
  |  Branch (294:13): [True: 7.56k, False: 49.5k]
  |  Branch (294:28): [True: 1.18k, False: 6.38k]
  ------------------
  295|  1.18k|      lexer->token = NETRC_TOK_ACCOUNT;
  296|  1.18k|    }
  297|  55.8k|    else if((slen == 5) && curl_strnequal(start, "login", slen)) {
  ------------------
  |  Branch (297:13): [True: 16.5k, False: 39.3k]
  |  Branch (297:28): [True: 16.0k, False: 542]
  ------------------
  298|  16.0k|      lexer->token = NETRC_TOK_LOGIN;
  299|  16.0k|    }
  300|  39.8k|    else if((slen == 8) && curl_strnequal(start, "password", slen)) {
  ------------------
  |  Branch (300:13): [True: 8.09k, False: 31.7k]
  |  Branch (300:28): [True: 6.71k, False: 1.38k]
  ------------------
  301|  6.71k|      lexer->token = NETRC_TOK_PASSWD;
  302|  6.71k|    }
  303|  33.1k|    else if((slen == 6) && curl_strnequal(start, "macdef", slen)) {
  ------------------
  |  Branch (303:13): [True: 6.13k, False: 27.0k]
  |  Branch (303:28): [True: 1.77k, False: 4.35k]
  ------------------
  304|  1.77k|      lexer->token = NETRC_TOK_MACDEF;
  305|  1.77k|    }
  306|  31.3k|    else {
  307|  31.3k|      lexer->token = NETRC_TOK_JUNK;
  308|  31.3k|    }
  309|  91.1k|    break;
  310|  93.6k|  }
  311|       |
  312|  93.6k|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|  93.6k|  lexer->pos = s;
  319|  93.6k|  return rc;
  320|  93.6k|}
netrc.c:netrc_skip_blanks:
  153|  93.6k|{
  154|  93.6k|  const char *s = lexer->pos;
  155|   129k|  while(*s) {
  ------------------
  |  Branch (155:9): [True: 128k, False: 632]
  ------------------
  156|   128k|    curlx_str_passblanks(&s);
  157|   134k|    while(*s == '\r')
  ------------------
  |  Branch (157:11): [True: 5.74k, False: 128k]
  ------------------
  158|  5.74k|      ++s;
  159|   128k|    if(*s == '\n') {
  ------------------
  |  Branch (159:8): [True: 35.9k, False: 93.0k]
  ------------------
  160|  35.9k|      ++s;
  161|  35.9k|    }
  162|  93.0k|    else
  163|  93.0k|      break;
  164|   128k|  }
  165|  93.6k|  lexer->pos = s;
  166|  93.6k|}
netrc.c:netrc_lexer_quoted:
  195|  1.84k|{
  196|  1.84k|  NETRCcode rc = NETRC_SYNTAX_ERROR;
  197|  1.84k|  const char *s = lexer->pos;
  198|  1.84k|  bool escape = FALSE;
  ------------------
  |  |  989|  1.84k|#define FALSE false
  ------------------
  199|  1.84k|  CURLcode result;
  200|       |
  201|  1.84k|  DEBUGASSERT(*s == '\"');
  ------------------
  |  | 1016|  1.84k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 1.84k]
  |  Branch (201:3): [True: 1.84k, False: 0]
  ------------------
  202|  1.84k|  ++s; /* pass the leading quote */
  203|   148k|  while(*s) {
  ------------------
  |  Branch (203:9): [True: 148k, False: 116]
  ------------------
  204|   148k|    char c = *s;
  205|   148k|    if(escape) {
  ------------------
  |  Branch (205:8): [True: 1.64k, False: 147k]
  ------------------
  206|  1.64k|      escape = FALSE;
  ------------------
  |  |  989|  1.64k|#define FALSE false
  ------------------
  207|  1.64k|      switch(c) {
  ------------------
  |  Branch (207:14): [True: 1.41k, False: 232]
  ------------------
  208|    197|      case 'n':
  ------------------
  |  Branch (208:7): [True: 197, False: 1.44k]
  ------------------
  209|    197|        c = '\n';
  210|    197|        break;
  211|    391|      case 'r':
  ------------------
  |  Branch (211:7): [True: 391, False: 1.25k]
  ------------------
  212|    391|        c = '\r';
  213|    391|        break;
  214|    826|      case 't':
  ------------------
  |  Branch (214:7): [True: 826, False: 820]
  ------------------
  215|    826|        c = '\t';
  216|    826|        break;
  217|  1.64k|      }
  218|  1.64k|    }
  219|   147k|    else if(c == '\\') {
  ------------------
  |  Branch (219:13): [True: 1.64k, False: 145k]
  ------------------
  220|  1.64k|      escape = TRUE;
  ------------------
  |  |  986|  1.64k|#define TRUE true
  ------------------
  221|  1.64k|      ++s;
  222|  1.64k|      continue;
  223|  1.64k|    }
  224|   145k|    else if(c == '\"') {
  ------------------
  |  Branch (224:13): [True: 1.72k, False: 143k]
  ------------------
  225|  1.72k|      ++s; /* pass the ending quote */
  226|       |      /* Ensure even an empty literal has a null-terminator. */
  227|  1.72k|      result = curlx_dyn_addn(&lexer->literal, "", 0);
  228|  1.72k|      rc = curl2netrc(result);
  ------------------
  |  |   84|  1.72k|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 1.72k, False: 0]
  |  |  |  Branch (84:25): [True: 0, False: 0]
  |  |  ------------------
  |  |   85|      0|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  229|  1.72k|      goto out;
  230|  1.72k|    }
  231|   145k|    result = curlx_dyn_addn(&lexer->literal, &c, 1);
  232|   145k|    if(result) {
  ------------------
  |  Branch (232:8): [True: 1, False: 145k]
  ------------------
  233|      1|      rc = curl2netrc(result);
  ------------------
  |  |   84|      1|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 0, False: 1]
  |  |  |  Branch (84:25): [True: 0, False: 1]
  |  |  ------------------
  |  |   85|      1|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  234|      1|      goto out;
  235|      1|    }
  236|   145k|    ++s;
  237|   145k|  }
  238|  1.84k|out:
  239|  1.84k|  lexer->pos = s;
  240|  1.84k|  return rc;
  241|  1.84k|}
netrc.c:netrc_scan_end_entry:
  382|  12.4k|{
  383|  12.4k|  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|  12.4k|  if(sc->matches_host) {
  ------------------
  |  Branch (389:6): [True: 9.65k, False: 2.75k]
  ------------------
  390|  9.65k|    if(sc->login) {
  ------------------
  |  Branch (390:8): [True: 8.76k, False: 890]
  ------------------
  391|  8.76k|      if(sc->user) {
  ------------------
  |  Branch (391:10): [True: 8.71k, False: 52]
  ------------------
  392|  8.71k|        if(Curl_timestrcmp(sc->user, sc->login))
  ------------------
  |  Branch (392:12): [True: 8.50k, False: 206]
  ------------------
  393|  8.50k|          goto out;
  394|       |        /* We look for a specific user,
  395|       |         * entry is only interesting with password */
  396|    206|        sc->found = !!sc->passwd;
  397|    206|      }
  398|     52|      else {
  399|     52|        sc->found = TRUE;
  ------------------
  |  |  986|     52|#define TRUE true
  ------------------
  400|     52|      }
  401|  8.76k|    }
  402|    890|    else if(sc->passwd) {
  ------------------
  |  Branch (402:13): [True: 46, False: 844]
  ------------------
  403|       |      /* found a passwd that applies to any user */
  404|     46|      sc->found = TRUE;
  ------------------
  |  |  986|     46|#define TRUE true
  ------------------
  405|     46|    }
  406|    844|    else {
  407|       |      /* entry has nothing interesting */
  408|    844|    }
  409|  1.14k|    if(sc->found) {
  ------------------
  |  Branch (409:8): [True: 98, False: 1.05k]
  ------------------
  410|       |#if NETRC_DEBUG
  411|       |      CURL_TRC_M(sc->lexer.data, "[NETRC] entry match found");
  412|       |#endif
  413|     98|      if(Curl_creds_create(sc->user ? sc->user : sc->login, sc->passwd,
  ------------------
  |  Branch (413:10): [True: 0, False: 98]
  |  Branch (413:28): [True: 43, False: 55]
  ------------------
  414|     98|                           NULL, NULL, NULL, CREDS_NETRC, &sc->creds))
  ------------------
  |  |   33|     98|#define CREDS_NETRC  3 /* username/passwd found in netrc */
  ------------------
  415|      0|        rc = NETRC_OUT_OF_MEMORY;
  416|     98|    }
  417|  1.14k|  }
  418|  12.4k|out:
  419|  12.4k|  netrc_scan_reset(sc);
  420|  12.4k|  return rc;
  421|  12.4k|}
netrc.c:netrc_lexer_push:
  244|     26|{
  245|       |  lexer->pushed = TRUE;
  ------------------
  |  |  986|     26|#define TRUE true
  ------------------
  246|     26|}
netrc.c:netrc_scan_literal:
  364|  23.9k|{
  365|  23.9k|  NETRCcode rc = netrc_lexer_next(&sc->lexer, TRUE);
  ------------------
  |  |  986|  23.9k|#define TRUE true
  ------------------
  366|  23.9k|  if(!rc) {
  ------------------
  |  Branch (366:6): [True: 23.8k, False: 17]
  ------------------
  367|  23.8k|    if(sc->lexer.token == NETRC_TOK_LITERAL) {
  ------------------
  |  Branch (367:8): [True: 23.8k, False: 21]
  ------------------
  368|  23.8k|      if(pdest && sc->matches_host) {
  ------------------
  |  Branch (368:10): [True: 22.7k, False: 1.17k]
  |  Branch (368:19): [True: 21.8k, False: 897]
  ------------------
  369|  21.8k|        curlx_free(*pdest);
  ------------------
  |  | 1503|  21.8k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  370|  21.8k|        *pdest = curlx_strdup(curlx_dyn_ptr(&sc->lexer.literal));
  ------------------
  |  | 1497|  21.8k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  371|  21.8k|        if(!*pdest)
  ------------------
  |  Branch (371:12): [True: 0, False: 21.8k]
  ------------------
  372|      0|          rc = NETRC_OUT_OF_MEMORY;
  373|  21.8k|      }
  374|  23.8k|    }
  375|     21|    else
  376|     21|      netrc_lexer_push(&sc->lexer);
  377|  23.8k|  }
  378|  23.9k|  return rc;
  379|  23.9k|}
netrc.c:netrc_skip_to_empty_line:
  169|  1.77k|{
  170|  1.77k|  const char *s = lexer->pos;
  171|  23.3k|  while(*s) {
  ------------------
  |  Branch (171:9): [True: 23.3k, False: 53]
  ------------------
  172|  23.3k|    if(*s == '\r')
  ------------------
  |  Branch (172:8): [True: 195, False: 23.1k]
  ------------------
  173|    195|      ++s;
  174|  23.1k|    else if(*s == '\n') {
  ------------------
  |  Branch (174:13): [True: 2.08k, False: 21.0k]
  ------------------
  175|  2.08k|      ++s;
  176|  2.27k|      while(*s == '\r')
  ------------------
  |  Branch (176:13): [True: 195, False: 2.08k]
  ------------------
  177|    195|        ++s;
  178|  2.08k|      if(*s == '\n')
  ------------------
  |  Branch (178:10): [True: 1.72k, False: 359]
  ------------------
  179|  1.72k|        goto out;
  180|  2.08k|    }
  181|  21.0k|    else
  182|  21.0k|      ++s;
  183|  23.3k|  }
  184|  1.77k|out:
  185|  1.77k|  lexer->pos = s;
  186|  1.77k|}
netrc.c:netrc_scan_cleanup:
  354|    789|{
  355|    789|  netrc_scan_reset(sc);
  356|    789|  sc->hostname = NULL;
  357|       |  sc->user = NULL;
  358|    789|  Curl_creds_unlink(&sc->creds);
  359|    789|  netrc_lexer_cleanup(&sc->lexer);
  360|    789|}
netrc.c:netrc_lexer_cleanup:
  146|    789|{
  147|    789|  lexer->content = lexer->pos = NULL;
  148|       |  lexer->data = NULL;
  149|    789|  curlx_dyn_free(&lexer->literal);
  150|    789|}

Curl_peer_unlink:
  313|  3.96k|{
  314|  3.96k|  if(*ppeer) {
  ------------------
  |  Branch (314:6): [True: 0, False: 3.96k]
  ------------------
  315|      0|    struct Curl_peer *peer = *ppeer;
  316|      0|    uint32_t newcount;
  317|       |
  318|      0|    *ppeer = NULL;
  319|       |
  320|      0|    newcount = Curl_refcount_decr(&peer->refcount);
  ------------------
  |  |   58|      0|  (atomic_fetch_sub_explicit(c, 1U, memory_order_acq_rel) - 1U)
  ------------------
  321|      0|    DEBUGASSERT(newcount < UINT32_MAX); /* wraparound check */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (321:5): [True: 0, False: 0]
  |  Branch (321:5): [True: 0, False: 0]
  ------------------
  322|       |
  323|      0|    if(!newcount)
  ------------------
  |  Branch (323:8): [True: 0, False: 0]
  ------------------
  324|      0|      curlx_free(peer);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  325|      0|  }
  326|  3.96k|}

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);
  ------------------
  |  | 1016|      2|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (150:3): [True: 0, False: 2]
  |  Branch (150:3): [True: 2, False: 0]
  ------------------
  151|       |
  152|      2|#ifdef USE_SSL
  153|       |  /* get all bytes in one call unless they are forced for testing */
  154|      2|  if(!env_override || !getenv("CURL_ENTROPY"))
  ------------------
  |  Branch (154:6): [True: 2, False: 0]
  |  Branch (154:23): [True: 0, False: 0]
  ------------------
  155|      2|    return Curl_ssl_random(data, rnd, num);
  156|      0|#endif
  157|       |
  158|      0|  while(num) {
  ------------------
  |  Branch (158:9): [True: 0, False: 0]
  ------------------
  159|      0|    unsigned int r;
  160|      0|    size_t left = num < sizeof(unsigned int) ? num : sizeof(unsigned int);
  ------------------
  |  Branch (160:19): [True: 0, False: 0]
  ------------------
  161|       |
  162|      0|    result = randit(data, &r, env_override);
  163|      0|    if(result)
  ------------------
  |  Branch (163:8): [True: 0, False: 0]
  ------------------
  164|      0|      return result;
  165|       |
  166|      0|    while(left) {
  ------------------
  |  Branch (166:11): [True: 0, False: 0]
  ------------------
  167|      0|      *rnd++ = (unsigned char)(r & 0xFF);
  168|      0|      r >>= 8;
  169|      0|      --num;
  170|      0|      --left;
  171|      0|    }
  172|      0|  }
  173|       |
  174|      0|  return result;
  175|      0|}

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

Curl_client_cleanup:
   66|    792|{
   67|    792|  cl_reset_reader(data);
   68|    792|  cl_reset_writer(data);
   69|       |
   70|    792|  data->req.bytecount = 0;
   71|    792|  data->req.headerline = 0;
   72|    792|}
sendf.c:cl_reset_reader:
   54|    792|{
   55|    792|  struct Curl_creader *reader = data->req.reader.stack;
   56|    792|  data->req.reader_started = FALSE;
  ------------------
  |  |  989|    792|#define FALSE false
  ------------------
   57|    792|  while(reader) {
  ------------------
  |  Branch (57:9): [True: 0, False: 792]
  ------------------
   58|      0|    data->req.reader.stack = reader->next;
   59|      0|    reader->crt->do_close(data, reader);
   60|      0|    curlx_free(reader);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   61|      0|    reader = data->req.reader.stack;
   62|      0|  }
   63|    792|}
sendf.c:cl_reset_writer:
   42|    792|{
   43|    792|  struct Curl_cwriter *writer = data->req.writer.stack;
   44|    792|  while(writer) {
  ------------------
  |  Branch (44:9): [True: 0, False: 792]
  ------------------
   45|      0|    data->req.writer.stack = writer->next;
   46|      0|    writer->cwt->do_close(data, writer);
   47|      0|    curlx_free(writer);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   48|      0|    writer = data->req.writer.stack;
   49|      0|  }
   50|       |  data->req.writer.paused = FALSE;
  ------------------
  |  |  989|    792|#define FALSE false
  ------------------
   51|    792|}

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

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

curl_slist_free_all:
  126|    792|{
  127|    792|  struct curl_slist *next;
  128|    792|  struct curl_slist *item;
  129|       |
  130|    792|  if(!list)
  ------------------
  |  Branch (130:6): [True: 792, False: 0]
  ------------------
  131|    792|    return;
  132|       |
  133|      0|  item = list;
  134|      0|  do {
  135|      0|    next = item->next;
  136|      0|    curlx_safefree(item->data);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  137|      0|    curlx_free(item);
  ------------------
  |  | 1503|      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|  8.71k|{
  118|  8.71k|  int match = 0;
  119|  8.71k|  int i = 0;
  120|       |
  121|  8.71k|  if(a && b) {
  ------------------
  |  Branch (121:6): [True: 8.71k, False: 0]
  |  Branch (121:11): [True: 8.71k, False: 0]
  ------------------
  122|  83.6k|    while(1) {
  ------------------
  |  Branch (122:11): [True: 83.6k, Folded]
  ------------------
  123|  83.6k|      match |= a[i] ^ b[i];
  124|  83.6k|      if(!a[i] || !b[i])
  ------------------
  |  Branch (124:10): [True: 8.12k, False: 75.5k]
  |  Branch (124:19): [True: 589, False: 74.9k]
  ------------------
  125|  8.71k|        break;
  126|  74.9k|      i++;
  127|  74.9k|    }
  128|  8.71k|  }
  129|      0|  else
  130|      0|    return a || b;
  ------------------
  |  Branch (130:12): [True: 0, False: 0]
  |  Branch (130:17): [True: 0, False: 0]
  ------------------
  131|  8.71k|  return match;
  132|  8.71k|}

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

curl_strequal:
   77|    519|{
   78|    519|  if(s1 && s2)
  ------------------
  |  Branch (78:6): [True: 519, False: 0]
  |  Branch (78:12): [True: 519, False: 0]
  ------------------
   79|       |    /* both pointers point to something then compare them */
   80|    519|    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|    519|}
curl_strnequal:
   88|  72.9k|{
   89|  72.9k|  if(s1 && s2)
  ------------------
  |  Branch (89:6): [True: 72.9k, False: 0]
  |  Branch (89:12): [True: 72.9k, False: 0]
  ------------------
   90|       |    /* both pointers point to something then compare them */
   91|  72.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|  72.9k|}
strequal.c:casecompare:
   36|    519|{
   37|  2.57k|  while(*first) {
  ------------------
  |  Branch (37:9): [True: 2.37k, False: 202]
  ------------------
   38|  2.37k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (38:8): [True: 317, False: 2.05k]
  ------------------
   39|       |      /* get out of the loop as soon as they do not match */
   40|    317|      return 0;
   41|  2.05k|    first++;
   42|  2.05k|    second++;
   43|  2.05k|  }
   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|    202|  return !*first == !*second;
   49|    519|}
strequal.c:ncasecompare:
   52|  72.9k|{
   53|   301k|  while(*first && max) {
  ------------------
  |  Branch (53:9): [True: 301k, False: 0]
  |  Branch (53:19): [True: 266k, False: 35.6k]
  ------------------
   54|   266k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (54:8): [True: 37.2k, False: 228k]
  ------------------
   55|  37.2k|      return 0;
   56|   228k|    max--;
   57|   228k|    first++;
   58|   228k|    second++;
   59|   228k|  }
   60|  35.6k|  if(max == 0)
  ------------------
  |  Branch (60:6): [True: 35.6k, False: 0]
  ------------------
   61|  35.6k|    return 1; /* they are equal this far */
   62|       |
   63|      0|  return Curl_raw_toupper(*first) == Curl_raw_toupper(*second);
   64|  35.6k|}

Curl_u8_strset_init:
   64|  2.37k|{
   65|       |#if defined(__GNUC__) && __GNUC__ >= 13
   66|       |#pragma GCC diagnostic push
   67|       |#pragma GCC diagnostic ignored "-Warray-bounds"
   68|       |#endif
   69|  2.37k|  memset(set, 0, sizeof(*set));
   70|       |#if defined(__GNUC__) && __GNUC__ >= 13
   71|       |#pragma GCC diagnostic pop
   72|       |#endif
   73|  2.37k|  set->data = set->sdata;
   74|  2.37k|  set->ids = set->sids;
   75|  2.37k|  set->psl = set->spsl;
   76|  2.37k|  set->slotbits = CURL_U8_STRSET_START_BITS;
  ------------------
  |  |   39|  2.37k|#define CURL_U8_STRSET_START_BITS   3
  ------------------
   77|  2.37k|  set->slotmask = CURL_U8_SLOT_MASK(set->slotbits);
  ------------------
  |  |   40|  2.37k|#define CURL_U8_SLOT_MASK(i)             (uint8_t)((1U << (i)) - 1)
  ------------------
   78|  2.37k|  set->count = 0;
   79|  2.37k|#ifdef DEBUGBUILD
   80|  2.37k|  set->init = CURL_U8_STRSET_MAGIC;
  ------------------
  |  |   31|  2.37k|#define CURL_U8_STRSET_MAGIC 0x7117e783
  ------------------
   81|  2.37k|#endif
   82|  2.37k|}
Curl_u8_strset_clear:
   85|    792|{
   86|    792|  uint16_t i;
   87|    792|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|    792|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:3): [True: 0, False: 792]
  |  Branch (87:3): [True: 792, False: 0]
  ------------------
   88|  7.12k|  for(i = 0; i < CURL_U8_STRSET_SLOT_CNT(set); ++i)
  ------------------
  |  |   41|  7.12k|#define CURL_U8_STRSET_SLOT_CNT(s)       CURL_U8_SLOT_CNT((s)->slotbits)
  |  |  ------------------
  |  |  |  |   39|  7.12k|#define CURL_U8_SLOT_CNT(i)              (uint16_t)((i) ? (1U << (i)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:53): [True: 7.12k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (88:14): [True: 6.33k, False: 792]
  ------------------
   89|  6.33k|    curlx_safefree(set->data[i]);
  ------------------
  |  | 1359|  7.12k|  do {                      \
  |  | 1360|  6.33k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  6.33k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  6.33k|    (ptr) = NULL;           \
  |  | 1362|  6.33k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 6.33k]
  |  |  ------------------
  ------------------
   90|       |
   91|    792|  if(set->data != set->sdata)
  ------------------
  |  Branch (91:6): [True: 0, False: 792]
  ------------------
   92|       |    curlx_safefree(set->data);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
   93|    792|  Curl_u8_strset_init(set);
   94|    792|}
Curl_u8_strset_get:
  199|  1.58k|{
  200|  1.58k|  uint8_t i;
  201|  1.58k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|  1.58k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 1.58k]
  |  Branch (201:3): [True: 1.58k, False: 0]
  ------------------
  202|  1.58k|  if(u8_strset_get_index(set, id, &i))
  ------------------
  |  Branch (202:6): [True: 0, False: 1.58k]
  ------------------
  203|      0|    return set->data[i];
  204|  1.58k|  return NULL;
  205|  1.58k|}
Curl_u8_strset_unset0:
  295|  3.96k|{
  296|       |  u8_strset_unset(set, id, TRUE);
  ------------------
  |  |  986|  3.96k|#define TRUE true
  ------------------
  297|  3.96k|}
u8_strset.c:u8_strset_get_index:
  169|  5.54k|{
  170|  5.54k|  uint8_t i = CURL_U8_STRSET_SLOT_IDX(set, id);
  ------------------
  |  |   38|  5.54k|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  171|  5.54k|  uint8_t psl = 0;
  172|  5.54k|  while(set->data[i] && (psl <= set->psl[i])) {
  ------------------
  |  Branch (172:9): [True: 0, False: 5.54k]
  |  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;
  ------------------
  |  |  986|      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.54k|  *pindex = 0;
  187|       |  return FALSE;
  ------------------
  |  |  989|  5.54k|#define FALSE false
  ------------------
  188|  5.54k|}
u8_strset.c:u8_strset_unset:
  264|  3.96k|{
  265|  3.96k|  uint8_t i, j;
  266|       |
  267|  3.96k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|  3.96k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (267:3): [True: 0, False: 3.96k]
  |  Branch (267:3): [True: 3.96k, False: 0]
  ------------------
  268|  3.96k|  if(u8_strset_get_index(set, id, &i)) {
  ------------------
  |  Branch (268:6): [True: 0, False: 3.96k]
  ------------------
  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]);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362: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|  3.96k|}

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

curl_url_cleanup:
 1559|    792|{
 1560|    792|  if(u) {
  ------------------
  |  Branch (1560:6): [True: 0, False: 792]
  ------------------
 1561|      0|    free_urlhandle(u);
 1562|      0|    curlx_free(u);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1563|      0|  }
 1564|    792|}

Curl_auth_digest_cleanup:
 1138|  1.58k|{
 1139|  1.58k|  Curl_peer_unlink(&digest->origin);
 1140|  1.58k|  Curl_creds_unlink(&digest->creds);
 1141|  1.58k|  curlx_safefree(digest->nonce);
  ------------------
  |  | 1359|  1.58k|  do {                      \
  |  | 1360|  1.58k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.58k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.58k|    (ptr) = NULL;           \
  |  | 1362|  1.58k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
 1142|  1.58k|  curlx_safefree(digest->cnonce);
  ------------------
  |  | 1359|  1.58k|  do {                      \
  |  | 1360|  1.58k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.58k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.58k|    (ptr) = NULL;           \
  |  | 1362|  1.58k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
 1143|  1.58k|  curlx_safefree(digest->realm);
  ------------------
  |  | 1359|  1.58k|  do {                      \
  |  | 1360|  1.58k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.58k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.58k|    (ptr) = NULL;           \
  |  | 1362|  1.58k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
 1144|  1.58k|  curlx_safefree(digest->opaque);
  ------------------
  |  | 1359|  1.58k|  do {                      \
  |  | 1360|  1.58k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.58k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.58k|    (ptr) = NULL;           \
  |  | 1362|  1.58k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
 1145|  1.58k|  curlx_safefree(digest->qop);
  ------------------
  |  | 1359|  1.58k|  do {                      \
  |  | 1360|  1.58k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.58k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.58k|    (ptr) = NULL;           \
  |  | 1362|  1.58k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
 1146|  1.58k|  curlx_safefree(digest->algorithm);
  ------------------
  |  | 1359|  1.58k|  do {                      \
  |  | 1360|  1.58k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.58k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.58k|    (ptr) = NULL;           \
  |  | 1362|  1.58k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
 1147|       |
 1148|  1.58k|  digest->nc = 0;
 1149|  1.58k|  digest->algo = ALGO_MD5; /* default algorithm */
  ------------------
  |  |   47|  1.58k|#define ALGO_MD5 0
  ------------------
 1150|  1.58k|  digest->stale = FALSE;   /* default means normal, not stale */
  ------------------
  |  |  989|  1.58k|#define FALSE false
  ------------------
 1151|       |  digest->userhash = FALSE;
  ------------------
  |  |  989|  1.58k|#define FALSE false
  ------------------
 1152|  1.58k|}

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:
 1177|    792|{
 1178|    792|  while(data->state.async) {
  ------------------
  |  Branch (1178:9): [True: 0, False: 792]
  ------------------
 1179|      0|    struct Curl_resolv_async *async = data->state.async;
 1180|      0|    data->state.async = async->next;
 1181|      0|    Curl_async_destroy(data, async);
 1182|      0|  }
 1183|    792|}

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:
  804|      2|{
  805|      2|  return RAND_status() != 0;
  806|      2|}
openssl.c:ossl_init:
 1628|      2|{
 1629|      2|  const uint64_t flags =
 1630|      2|#ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN
 1631|       |    /* not present in BoringSSL */
 1632|      2|    OPENSSL_INIT_ENGINE_ALL_BUILTIN |
 1633|      2|#endif
 1634|       |#ifdef CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
 1635|       |    OPENSSL_INIT_NO_LOAD_CONFIG |
 1636|       |#else
 1637|      2|    OPENSSL_INIT_LOAD_CONFIG |
 1638|      2|#endif
 1639|      2|    0;
 1640|      2|  OPENSSL_init_ssl(flags, NULL);
 1641|       |
 1642|      2|#ifndef HAVE_KEYLOG_UPSTREAM
 1643|      2|  Curl_tls_keylog_open();
 1644|      2|#endif
 1645|       |
 1646|      2|  return 1;
 1647|      2|}
openssl.c:ossl_random:
 5508|      2|{
 5509|      2|  int rc;
 5510|      2|  if(data) {
  ------------------
  |  Branch (5510:6): [True: 0, False: 2]
  ------------------
 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|      2|  else {
 5515|      2|    if(!rand_enough())
  ------------------
  |  Branch (5515:8): [True: 0, False: 2]
  ------------------
 5516|      0|      return CURLE_FAILED_INIT;
 5517|      2|  }
 5518|       |  /* RAND_bytes() returns 1 on success, 0 otherwise. */
 5519|      2|  rc = RAND_bytes(entropy, (ossl_valsize_t)curlx_uztosi(length));
 5520|      2|  return rc == 1 ? CURLE_OK : CURLE_FAILED_INIT;
  ------------------
  |  Branch (5520:10): [True: 2, False: 0]
  ------------------
 5521|      2|}
openssl.c:ossl_close_all:
 2039|    792|{
 2040|    792|  (void)data;
 2041|    792|}

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 */
  ------------------
  |  |  986|      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|    792|{
  229|    792|  if(Curl_ssl->close_all)
  ------------------
  |  Branch (229:6): [True: 792, False: 0]
  ------------------
  230|    792|    Curl_ssl->close_all(data);
  231|    792|}
Curl_ssl_free_certinfo:
  279|  1.58k|{
  280|  1.58k|  struct curl_certinfo *ci = &data->info.certs;
  281|       |
  282|  1.58k|  if(ci->num_of_certs) {
  ------------------
  |  Branch (282:6): [True: 0, False: 1.58k]
  ------------------
  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 */
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  291|      0|    ci->num_of_certs = 0;
  292|      0|  }
  293|  1.58k|}
Curl_ssl_random:
  351|      2|{
  352|      2|  if(Curl_ssl->random)
  ------------------
  |  Branch (352:6): [True: 2, False: 0]
  ------------------
  353|      2|    return Curl_ssl->random(data, buffer, length);
  354|      0|  else
  355|      0|    return CURLE_NOT_BUILT_IN;
  356|      2|}

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

LLVMFuzzerTestOneInput:
   73|    801|                                      std::size_t size) {
   74|    801|  if (size == 0 || !WriteNetrcInput(data + 1, size - 1) ||
  ------------------
  |  Branch (74:7): [True: 0, False: 801]
  |  Branch (74:20): [True: 9, False: 792]
  ------------------
   75|    792|      kInputFile.path() == nullptr) {
  ------------------
  |  Branch (75:7): [True: 0, False: 792]
  ------------------
   76|      9|    return 0;
   77|      9|  }
   78|       |
   79|    792|  ProbeErrorStringsOnce();
   80|       |
   81|    792|  CURL *easy = curl_easy_init();
   82|    792|  if (easy == nullptr) {
  ------------------
  |  Branch (82:7): [True: 0, False: 792]
  ------------------
   83|      0|    return 0;
   84|      0|  }
   85|       |
   86|       |  // Use curl's real private type so layout/API changes fail at compile time.
   87|    792|  struct store_netrc store;
   88|    792|  struct Curl_creds *creds = nullptr;
   89|    792|  Curl_netrc_init(&store);
   90|       |
   91|    792|  const char *hostname = (data[0] & 1U) != 0 ? "other.test" : "fuzz.test";
  ------------------
  |  Branch (91:26): [True: 277, False: 515]
  ------------------
   92|    792|  const char *user = (data[0] & 2U) != 0 ? "fuzz-user" : nullptr;
  ------------------
  |  Branch (92:22): [True: 368, False: 424]
  ------------------
   93|    792|  const NETRCcode result =
   94|    792|      Curl_netrc_scan(reinterpret_cast<struct Curl_easy *>(easy), &store,
   95|    792|                      hostname, user, kInputFile.path(), &creds);
   96|    792|  (void)Curl_netrc_strerror(result);
   97|       |
   98|    792|  Curl_creds_unlink(&creds);
   99|    792|  Curl_netrc_cleanup(&store);
  100|    792|  curl_easy_cleanup(easy);
  101|    792|  return 0;
  102|    792|}
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|    801|bool WriteNetrcInput(const std::uint8_t *data, std::size_t size) {
   47|    801|  if (size > kMaxNetrcBytes) {
  ------------------
  |  Branch (47:7): [True: 9, False: 792]
  ------------------
   48|      9|    return false;
   49|      9|  }
   50|       |
   51|    792|  std::string file_contents(1, '\n');
   52|    792|  if (size != 0) {
  ------------------
  |  Branch (52:7): [True: 790, False: 2]
  ------------------
   53|    790|    file_contents.append(reinterpret_cast<const char *>(data), size);
   54|    790|  }
   55|    792|  return kInputFile.Write(
   56|    792|      reinterpret_cast<const std::uint8_t *>(file_contents.data()),
   57|    792|      file_contents.size());
   58|    801|}
fuzz_netrc.cc:_ZN12_GLOBAL__N_121ProbeErrorStringsOnceEv:
   60|    792|void ProbeErrorStringsOnce() {
   61|    792|  static const bool probed = [] {
   62|    792|    for (int value = 0; value < static_cast<int>(NETRC_LAST); ++value) {
   63|    792|      (void)Curl_netrc_strerror(static_cast<NETRCcode>(value));
   64|    792|    }
   65|    792|    return true;
   66|    792|  }();
   67|    792|  (void)probed;
   68|    792|}
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|    792|bool BoundedAnonymousInputFile::EnsureOpen() {
   36|    792|  if (file_ != nullptr) {
  ------------------
  |  Branch (36:7): [True: 791, False: 1]
  ------------------
   37|    791|    return true;
   38|    791|  }
   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|    792|bool BoundedAnonymousInputFile::Write(const std::uint8_t* data, std::size_t size) {
   61|    792|  ready_ = false;
   62|    792|  if (size > max_bytes_ || (data == nullptr && size != 0) || !EnsureOpen()) {
  ------------------
  |  Branch (62:7): [True: 0, False: 792]
  |  Branch (62:29): [True: 0, False: 792]
  |  Branch (62:48): [True: 0, False: 0]
  |  Branch (62:62): [True: 0, False: 792]
  ------------------
   63|      0|    return false;
   64|      0|  }
   65|       |
   66|    792|  const int fd = fileno(file_);
   67|    792|  if (fd < 0 || ftruncate(fd, 0) != 0) {
  ------------------
  |  Branch (67:7): [True: 0, False: 792]
  |  Branch (67:17): [True: 0, False: 792]
  ------------------
   68|      0|    return false;
   69|      0|  }
   70|       |
   71|    792|  std::size_t offset = 0;
   72|  1.58k|  while (offset < size) {
  ------------------
  |  Branch (72:10): [True: 792, False: 792]
  ------------------
   73|    792|    const ssize_t written = pwrite(fd, data + offset, size - offset, static_cast<off_t>(offset));
   74|    792|    if (written < 0 && errno == EINTR) {
  ------------------
  |  Branch (74:9): [True: 0, False: 792]
  |  Branch (74:24): [True: 0, False: 0]
  ------------------
   75|      0|      continue;
   76|      0|    }
   77|    792|    if (written <= 0) {
  ------------------
  |  Branch (77:9): [True: 0, False: 792]
  ------------------
   78|      0|      return false;
   79|      0|    }
   80|    792|    offset += static_cast<std::size_t>(written);
   81|    792|  }
   82|       |
   83|    792|  ready_ = true;
   84|    792|  return true;
   85|    792|}
_ZNK12proto_fuzzer25BoundedAnonymousInputFile4pathEv:
   89|  1.58k|const char* BoundedAnonymousInputFile::path() const { return ready_ ? path_.c_str() : nullptr; }
  ------------------
  |  Branch (89:62): [True: 1.58k, False: 0]
  ------------------

