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


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

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

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

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

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

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

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

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

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

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

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

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

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

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