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


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

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

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

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

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

crypto/mem.c:295:1: parameter `str` of CRYPTO_free
      293.   }
      294.   
      295. > void CRYPTO_free(void *str, const char *file, int line)
      296.   {
      297.       INCREMENT(free_count);

crypto/mem.c:312:5: was invalidated by call to `free()`
      310.       }
      311.   #else
      312.       free(str);
                 ^
      313.   #endif
      314.   }

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

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

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

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

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

crypto/mem.c:295:1: parameter `str` of CRYPTO_free
      293.   }
      294.   
      295. > void CRYPTO_free(void *str, const char *file, int line)
      296.   {
      297.       INCREMENT(free_count);

crypto/mem.c:312:5: invalid access occurs here
      310.       }
      311.   #else
      312.       free(str);
                 ^
      313.   #endif
      314.   }
