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


apps/s_client.c:633:13: invalidation part of the trace starts here
631.       for (i = 0; i < num; ++i) {
632.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
633.           if (tlsa_import_rr(con, rrdata) > 0)
                   ^
634.               ++count;
635.       }

apps/s_client.c:633:13: global variable `tlsa_import_rr.data` accessed here
  631.       for (i = 0; i < num; ++i) {
  632.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  633.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  634.               ++count;
  635.       }

apps/s_client.c:633:13: when calling `tlsa_import_rr` here
  631.       for (i = 0; i < num; ++i) {
  632.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  633.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  634.               ++count;
  635.       }

apps/s_client.c:590:9: global variable `tlsa_import_rr.data` accessed here
    588.           { &selector, "selector", checked_uint8 },
    589.           { &mtype, "mtype", checked_uint8 },
    590.           { &data, "data", hexdecode },
                   ^
    591.           { NULL, }
    592.       };

apps/s_client.c:608:5: when calling `CRYPTO_free` here
    606.       /* The data field is last, so len is its length */
    607.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    608.       OPENSSL_free(data);
               ^
    609.   
    610.       if (ret == 0) {

crypto/mem.c:222:1: parameter `str` of CRYPTO_free
      220.   }
      221.   
      222. > void CRYPTO_free(void *str, const char *file, int line)
      223.   {
      224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:238:5: was invalidated by call to `free()`
      236.       }
      237.   #else
      238.       free(str);
                 ^
      239.   #endif
      240.   }

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

apps/s_client.c:633:13: global variable `tlsa_import_rr.data` accessed here
  631.       for (i = 0; i < num; ++i) {
  632.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  633.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  634.               ++count;
  635.       }

apps/s_client.c:633:13: when calling `tlsa_import_rr` here
  631.       for (i = 0; i < num; ++i) {
  632.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  633.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  634.               ++count;
  635.       }

apps/s_client.c:590:9: global variable `tlsa_import_rr.data` accessed here
    588.           { &selector, "selector", checked_uint8 },
    589.           { &mtype, "mtype", checked_uint8 },
    590.           { &data, "data", hexdecode },
                   ^
    591.           { NULL, }
    592.       };

apps/s_client.c:608:5: when calling `CRYPTO_free` here
    606.       /* The data field is last, so len is its length */
    607.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    608.       OPENSSL_free(data);
               ^
    609.   
    610.       if (ret == 0) {

crypto/mem.c:222:1: parameter `str` of CRYPTO_free
      220.   }
      221.   
      222. > void CRYPTO_free(void *str, const char *file, int line)
      223.   {
      224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:238:5: invalid access occurs here
      236.       }
      237.   #else
      238.       free(str);
                 ^
      239.   #endif
      240.   }
