ssl/ssl_lib.c:325: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_zalloc()` at line 315, column 14 is not reachable after line 325, column 9.
Showing all 53 steps of the trace


ssl/ssl_lib.c:264:1: start of procedure dane_tlsa_add()
262.   }
263.   
264. > static int dane_tlsa_add(
265.       SSL_DANE *dane,
266.       uint8_t usage,

ssl/ssl_lib.c:273:5: 
271.   {
272.       danetls_record *t;
273. >     const EVP_MD *md = NULL;
274.       int ilen = (int)dlen;
275.       int i;

ssl/ssl_lib.c:274:5: 
272.       danetls_record *t;
273.       const EVP_MD *md = NULL;
274. >     int ilen = (int)dlen;
275.       int i;
276.       int num;

ssl/ssl_lib.c:278:9: Taking false branch
276.       int num;
277.   
278.       if (dane->trecs == NULL) {
               ^
279.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_NOT_ENABLED);
280.           return -1;

ssl/ssl_lib.c:283:9: Taking false branch
281.       }
282.   
283.       if (ilen < 0 || dlen != (size_t)ilen) {
               ^
284.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DATA_LENGTH);
285.           return 0;

ssl/ssl_lib.c:283:21: Taking false branch
281.       }
282.   
283.       if (ilen < 0 || dlen != (size_t)ilen) {
                           ^
284.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DATA_LENGTH);
285.           return 0;

ssl/ssl_lib.c:288:9: Taking false branch
286.       }
287.   
288.       if (usage > DANETLS_USAGE_LAST) {
               ^
289.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE);
290.           return 0;

ssl/ssl_lib.c:293:9: Taking false branch
291.       }
292.   
293.       if (selector > DANETLS_SELECTOR_LAST) {
               ^
294.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_SELECTOR);
295.           return 0;

ssl/ssl_lib.c:298:9: Taking true branch
296.       }
297.   
298.       if (mtype != DANETLS_MATCHING_FULL) {
               ^
299.           md = tlsa_md_get(dane, mtype);
300.           if (md == NULL) {

ssl/ssl_lib.c:299:9: 
297.   
298.       if (mtype != DANETLS_MATCHING_FULL) {
299. >         md = tlsa_md_get(dane, mtype);
300.           if (md == NULL) {
301.               SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE);

ssl/ssl_lib.c:257:1: start of procedure tlsa_md_get()
  255.   }
  256.   
  257. > static const EVP_MD *tlsa_md_get(SSL_DANE *dane, uint8_t mtype)
  258.   {
  259.       if (mtype > dane->dctx->mdmax)

ssl/ssl_lib.c:259:9: Taking false branch
  257.   static const EVP_MD *tlsa_md_get(SSL_DANE *dane, uint8_t mtype)
  258.   {
  259.       if (mtype > dane->dctx->mdmax)
                 ^
  260.           return NULL;
  261.       return dane->dctx->mdevp[mtype];

ssl/ssl_lib.c:261:5: 
  259.       if (mtype > dane->dctx->mdmax)
  260.           return NULL;
  261. >     return dane->dctx->mdevp[mtype];
  262.   }
  263.   

ssl/ssl_lib.c:262:1: return from a call to tlsa_md_get
  260.           return NULL;
  261.       return dane->dctx->mdevp[mtype];
  262. > }
  263.   
  264.   static int dane_tlsa_add(

ssl/ssl_lib.c:300:13: Taking false branch
298.       if (mtype != DANETLS_MATCHING_FULL) {
299.           md = tlsa_md_get(dane, mtype);
300.           if (md == NULL) {
                   ^
301.               SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE);
302.               return 0;

ssl/ssl_lib.c:306:9: Taking true branch
304.       }
305.   
306.       if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
               ^
307.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
308.           return 0;

ssl/ssl_lib.c:306:23: 
304.       }
305.   
306. >     if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
307.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
308.           return 0;

crypto/evp/evp_lib.c:301:1: start of procedure EVP_MD_size()
  299.   }
  300.   
  301. > int EVP_MD_size(const EVP_MD *md)
  302.   {
  303.       if (!md) {

crypto/evp/evp_lib.c:303:10: Taking false branch
  301.   int EVP_MD_size(const EVP_MD *md)
  302.   {
  303.       if (!md) {
                  ^
  304.           EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
  305.           return -1;

crypto/evp/evp_lib.c:307:5: 
  305.           return -1;
  306.       }
  307. >     return md->md_size;
  308.   }
  309.   

crypto/evp/evp_lib.c:308:1: return from a call to EVP_MD_size
  306.       }
  307.       return md->md_size;
  308. > }
  309.   
  310.   unsigned long EVP_MD_flags(const EVP_MD *md)

ssl/ssl_lib.c:306:23: Taking false branch
304.       }
305.   
306.       if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
                             ^
307.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
308.           return 0;

ssl/ssl_lib.c:310:10: Taking false branch
308.           return 0;
309.       }
310.       if (!data) {
                ^
311.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_NULL_DATA);
312.           return 0;

ssl/ssl_lib.c:315:9: 
313.       }
314.   
315. >     if ((t = OPENSSL_zalloc(sizeof(*t))) == NULL) {
316.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
317.           return -1;

crypto/mem.c:98:1: start of procedure CRYPTO_zalloc()
  96.   }
  97.   
  98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  99.   {
  100.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:100:5: 
  98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  99.   {
  100. >     void *ret = CRYPTO_malloc(num, file, line);
  101.   
  102.       if (ret != NULL)

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
    69.   }
    70.   
    71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73.       void *ret = NULL;

crypto/mem.c:73:5: 
    71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73. >     void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
    73.       void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                  ^
    76.           return malloc_impl(num, file, line);
    77.   

crypto/mem.c:78:9: Taking false branch
    76.           return malloc_impl(num, file, line);
    77.   
    78.       if (num <= 0)
                  ^
    79.           return NULL;
    80.   

crypto/mem.c:81:5: 
    79.           return NULL;
    80.   
    81. >     allow_customize = 0;
    82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:91:24: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:92:5: 
    90.   #else
    91.       osslargused(file); osslargused(line);
    92. >     ret = malloc(num);
    93.   #endif
    94.   

crypto/mem.c:95:5: 
    93.   #endif
    94.   
    95. >     return ret;
    96.   }
    97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
    94.   
    95.       return ret;
    96. > }
    97.   
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:102:9: Taking true branch
  100.       void *ret = CRYPTO_malloc(num, file, line);
  101.   
  102.       if (ret != NULL)
                 ^
  103.           memset(ret, 0, num);
  104.       return ret;

crypto/mem.c:103:9: 
  101.   
  102.       if (ret != NULL)
  103. >         memset(ret, 0, num);
  104.       return ret;
  105.   }

crypto/mem.c:104:5: 
  102.       if (ret != NULL)
  103.           memset(ret, 0, num);
  104. >     return ret;
  105.   }
  106.   

crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
  103.           memset(ret, 0, num);
  104.       return ret;
  105. > }
  106.   
  107.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

ssl/ssl_lib.c:315:9: Taking false branch
313.       }
314.   
315.       if ((t = OPENSSL_zalloc(sizeof(*t))) == NULL) {
               ^
316.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
317.           return -1;

ssl/ssl_lib.c:320:5: 
318.       }
319.   
320. >     t->usage = usage;
321.       t->selector = selector;
322.       t->mtype = mtype;

ssl/ssl_lib.c:321:5: 
319.   
320.       t->usage = usage;
321. >     t->selector = selector;
322.       t->mtype = mtype;
323.       t->data = OPENSSL_malloc(ilen);

ssl/ssl_lib.c:322:5: 
320.       t->usage = usage;
321.       t->selector = selector;
322. >     t->mtype = mtype;
323.       t->data = OPENSSL_malloc(ilen);
324.       if (t->data == NULL) {

ssl/ssl_lib.c:323:5: 
321.       t->selector = selector;
322.       t->mtype = mtype;
323. >     t->data = OPENSSL_malloc(ilen);
324.       if (t->data == NULL) {
325.           tlsa_free(t);

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
  69.   }
  70.   
  71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73.       void *ret = NULL;

crypto/mem.c:73:5: 
  71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73. >     void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking true branch
  73.       void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                ^
  76.           return malloc_impl(num, file, line);
  77.   

crypto/mem.c:75:32: Taking true branch
  73.       void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                       ^
  76.           return malloc_impl(num, file, line);
  77.   

crypto/mem.c:76:9: Skipping __function_pointer__(): unresolved function pointer
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
  76.           return malloc_impl(num, file, line);
                ^
  77.   
  78.       if (num <= 0)

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
  94.   
  95.       return ret;
  96. > }
  97.   
  98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

ssl/ssl_lib.c:324:9: Taking true branch
322.       t->mtype = mtype;
323.       t->data = OPENSSL_malloc(ilen);
324.       if (t->data == NULL) {
               ^
325.           tlsa_free(t);
326.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);

ssl/ssl_lib.c:325:9: Skipping tlsa_free(): empty list of specs
323.       t->data = OPENSSL_malloc(ilen);
324.       if (t->data == NULL) {
325.           tlsa_free(t);
               ^
326.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
327.           return -1;
