apps/s_client.c:638: error: USE_AFTER_FREE
  call to `tlsa_import_rr()` eventually accesses memory that was invalidated by call to `free()` on line 638 indirectly during the call to `tlsa_import_rr()`.
Showing all 14 steps of the trace


apps/s_client.c:638:13: invalidation part of the trace starts here
636.       for (i = 0; i < num; ++i) {
637.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
638.           if (tlsa_import_rr(con, rrdata) > 0)
                   ^
639.               ++count;
640.       }

apps/s_client.c:638:13: global variable `tlsa_import_rr.data` accessed here
  636.       for (i = 0; i < num; ++i) {
  637.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  638.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  639.               ++count;
  640.       }

apps/s_client.c:638:13: when calling `tlsa_import_rr` here
  636.       for (i = 0; i < num; ++i) {
  637.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  638.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  639.               ++count;
  640.       }

apps/s_client.c:595:9: global variable `tlsa_import_rr.data` accessed here
    593.           { &selector, "selector", checked_uint8 },
    594.           { &mtype, "mtype", checked_uint8 },
    595.           { &data, "data", hexdecode },
                   ^
    596.           { NULL, }
    597.       };

apps/s_client.c:613:5: when calling `CRYPTO_free` here
    611.       /* The data field is last, so len is its length */
    612.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    613.       OPENSSL_free(data);
               ^
    614.   
    615.       if (ret == 0) {

crypto/mem.c:211:1: parameter `str` of CRYPTO_free
      209.   }
      210.   
      211. > void CRYPTO_free(void *str, const char *file, int line)
      212.   {
      213.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:227:5: was invalidated by call to `free()`
      225.       }
      226.   #else
      227.       free(str);
                 ^
      228.   #endif
      229.   }

apps/s_client.c:638:13: use-after-lifetime part of the trace starts here
636.       for (i = 0; i < num; ++i) {
637.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
638.           if (tlsa_import_rr(con, rrdata) > 0)
                   ^
639.               ++count;
640.       }

apps/s_client.c:638:13: global variable `tlsa_import_rr.data` accessed here
  636.       for (i = 0; i < num; ++i) {
  637.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  638.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  639.               ++count;
  640.       }

apps/s_client.c:638:13: when calling `tlsa_import_rr` here
  636.       for (i = 0; i < num; ++i) {
  637.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  638.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  639.               ++count;
  640.       }

apps/s_client.c:595:9: global variable `tlsa_import_rr.data` accessed here
    593.           { &selector, "selector", checked_uint8 },
    594.           { &mtype, "mtype", checked_uint8 },
    595.           { &data, "data", hexdecode },
                   ^
    596.           { NULL, }
    597.       };

apps/s_client.c:613:5: when calling `CRYPTO_free` here
    611.       /* The data field is last, so len is its length */
    612.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    613.       OPENSSL_free(data);
               ^
    614.   
    615.       if (ret == 0) {

crypto/mem.c:211:1: parameter `str` of CRYPTO_free
      209.   }
      210.   
      211. > void CRYPTO_free(void *str, const char *file, int line)
      212.   {
      213.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:227:5: invalid access occurs here
      225.       }
      226.   #else
      227.       free(str);
                 ^
      228.   #endif
      229.   }
