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


apps/s_client.c:563:13: invalidation part of the trace starts here
561.       for (i = 0; i < num; ++i) {
562.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
563.           if (tlsa_import_rr(con, rrdata) > 0)
                   ^
564.               ++count;
565.       }

apps/s_client.c:563:13: global variable `tlsa_import_rr.data` accessed here
  561.       for (i = 0; i < num; ++i) {
  562.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  563.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  564.               ++count;
  565.       }

apps/s_client.c:563:13: when calling `tlsa_import_rr` here
  561.       for (i = 0; i < num; ++i) {
  562.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  563.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  564.               ++count;
  565.       }

apps/s_client.c:520:9: global variable `tlsa_import_rr.data` accessed here
    518.           { &selector, "selector", checked_uint8 },
    519.           { &mtype, "mtype", checked_uint8 },
    520.           { &data, "data", hexdecode },
                   ^
    521.           { NULL, }
    522.       };

apps/s_client.c:538:5: when calling `CRYPTO_free` here
    536.       /* The data field is last, so len is its length */
    537.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    538.       OPENSSL_free(data);
               ^
    539.   
    540.       if (ret == 0) {

crypto/mem.c:286:1: parameter `str` of CRYPTO_free
      284.   }
      285.   
      286. > void CRYPTO_free(void *str, const char *file, int line)
      287.   {
      288.       INCREMENT(free_count);

crypto/mem.c:303:5: was invalidated by call to `free()`
      301.       }
      302.   #else
      303.       free(str);
                 ^
      304.   #endif
      305.   }

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

apps/s_client.c:563:13: global variable `tlsa_import_rr.data` accessed here
  561.       for (i = 0; i < num; ++i) {
  562.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  563.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  564.               ++count;
  565.       }

apps/s_client.c:563:13: when calling `tlsa_import_rr` here
  561.       for (i = 0; i < num; ++i) {
  562.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  563.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  564.               ++count;
  565.       }

apps/s_client.c:520:9: global variable `tlsa_import_rr.data` accessed here
    518.           { &selector, "selector", checked_uint8 },
    519.           { &mtype, "mtype", checked_uint8 },
    520.           { &data, "data", hexdecode },
                   ^
    521.           { NULL, }
    522.       };

apps/s_client.c:538:5: when calling `CRYPTO_free` here
    536.       /* The data field is last, so len is its length */
    537.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    538.       OPENSSL_free(data);
               ^
    539.   
    540.       if (ret == 0) {

crypto/mem.c:286:1: parameter `str` of CRYPTO_free
      284.   }
      285.   
      286. > void CRYPTO_free(void *str, const char *file, int line)
      287.   {
      288.       INCREMENT(free_count);

crypto/mem.c:303:5: invalid access occurs here
      301.       }
      302.   #else
      303.       free(str);
                 ^
      304.   #endif
      305.   }
