ssl/t1_lib.c:3085: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `EVP_CIPHER_CTX_new()` at line 3071, column 11 is not reachable after line 3085, column 13.
Showing all 50 steps of the trace


ssl/t1_lib.c:3052:1: start of procedure tls_decrypt_ticket()
3050.    *    4: same as 3, but the ticket needs to be renewed.
3051.    */
3052. > static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
3053.                                 int eticklen, const unsigned char *sess_id,
3054.                                 int sesslen, SSL_SESSION **psess)

ssl/t1_lib.c:3059:5: 
3057.       unsigned char *sdec;
3058.       const unsigned char *p;
3059. >     int slen, mlen, renew_ticket = 0;
3060.       unsigned char tick_hmac[EVP_MAX_MD_SIZE];
3061.       HMAC_CTX *hctx = NULL;

ssl/t1_lib.c:3061:5: 
3059.       int slen, mlen, renew_ticket = 0;
3060.       unsigned char tick_hmac[EVP_MAX_MD_SIZE];
3061. >     HMAC_CTX *hctx = NULL;
3062.       EVP_CIPHER_CTX *ctx;
3063.       SSL_CTX *tctx = s->initial_ctx;

ssl/t1_lib.c:3063:5: 
3061.       HMAC_CTX *hctx = NULL;
3062.       EVP_CIPHER_CTX *ctx;
3063. >     SSL_CTX *tctx = s->initial_ctx;
3064.       /* Need at least keyname + iv + some encrypted data */
3065.       if (eticklen < 48)

ssl/t1_lib.c:3065:9: Taking false branch
3063.       SSL_CTX *tctx = s->initial_ctx;
3064.       /* Need at least keyname + iv + some encrypted data */
3065.       if (eticklen < 48)
                ^
3066.           return 2;
3067.       /* Initialize session ticket encryption and HMAC contexts */

ssl/t1_lib.c:3068:5: 
3066.           return 2;
3067.       /* Initialize session ticket encryption and HMAC contexts */
3068. >     hctx = HMAC_CTX_new();
3069.       if (hctx == NULL)
3070.           return -2;

crypto/hmac/hmac.c:172:1: start of procedure HMAC_CTX_new()
  170.   }
  171.   
  172. > HMAC_CTX *HMAC_CTX_new(void)
  173.   {
  174.       HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX));

crypto/hmac/hmac.c:174:5: 
  172.   HMAC_CTX *HMAC_CTX_new(void)
  173.   {
  174. >     HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX));
  175.   
  176.       if (ctx != NULL) {

crypto/mem.c:156:1: start of procedure CRYPTO_zalloc()
    154.   }
    155.   
    156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:158:5: 
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158. >     void *ret = CRYPTO_malloc(num, file, line);
    159.   
    160.       if (ret != NULL)

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
      117.   }
      118.   
      119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121.       void *ret = NULL;

crypto/mem.c:121:5: 
      119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121. >     void *ret = NULL;
      122.   
      123.       if (num <= 0)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (num <= 0)
                     ^
      124.           return NULL;
      125.   

crypto/mem.c:126:5: 
      124.           return NULL;
      125.   
      126. >     allow_customize = 0;
      127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
      134.       }
      135.   #else
      136. >     (void)file;
      137.       (void)line;
      138.       ret = malloc(num);

crypto/mem.c:137:5: 
      135.   #else
      136.       (void)file;
      137. >     (void)line;
      138.       ret = malloc(num);
      139.   #endif

crypto/mem.c:138:5: 
      136.       (void)file;
      137.       (void)line;
      138. >     ret = malloc(num);
      139.   #endif
      140.   

crypto/mem.c:153:5: 
      151.   #endif
      152.   
      153. >     return ret;
      154.   }
      155.   

crypto/mem.c:154:1: return from a call to CRYPTO_malloc
      152.   
      153.       return ret;
      154. > }
      155.   
      156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:160:9: Taking true branch
    158.       void *ret = CRYPTO_malloc(num, file, line);
    159.   
    160.       if (ret != NULL)
                   ^
    161.           memset(ret, 0, num);
    162.       return ret;

crypto/mem.c:161:9: 
    159.   
    160.       if (ret != NULL)
    161. >         memset(ret, 0, num);
    162.       return ret;
    163.   }

crypto/mem.c:162:5: 
    160.       if (ret != NULL)
    161.           memset(ret, 0, num);
    162. >     return ret;
    163.   }
    164.   

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
    161.           memset(ret, 0, num);
    162.       return ret;
    163. > }
    164.   
    165.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/hmac/hmac.c:176:9: Taking true branch
  174.       HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX));
  175.   
  176.       if (ctx != NULL) {
                 ^
  177.           if (!HMAC_CTX_reset(ctx)) {
  178.               HMAC_CTX_free(ctx);

crypto/hmac/hmac.c:177:14: Taking false branch
  175.   
  176.       if (ctx != NULL) {
  177.           if (!HMAC_CTX_reset(ctx)) {
                      ^
  178.               HMAC_CTX_free(ctx);
  179.               return NULL;

crypto/hmac/hmac.c:182:5: 
  180.           }
  181.       }
  182. >     return ctx;
  183.   }
  184.   

crypto/hmac/hmac.c:183:1: return from a call to HMAC_CTX_new
  181.       }
  182.       return ctx;
  183. > }
  184.   
  185.   static void hmac_ctx_cleanup(HMAC_CTX *ctx)

ssl/t1_lib.c:3069:9: Taking false branch
3067.       /* Initialize session ticket encryption and HMAC contexts */
3068.       hctx = HMAC_CTX_new();
3069.       if (hctx == NULL)
                ^
3070.           return -2;
3071.       ctx = EVP_CIPHER_CTX_new();

ssl/t1_lib.c:3071:5: 
3069.       if (hctx == NULL)
3070.           return -2;
3071. >     ctx = EVP_CIPHER_CTX_new();
3072.       if (tctx->tlsext_ticket_key_cb) {
3073.           unsigned char *nctick = (unsigned char *)etick;

crypto/evp/evp_enc.c:93:1: start of procedure EVP_CIPHER_CTX_new()
  91.   }
  92.   
  93. > EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
  94.   {
  95.       return OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));

crypto/evp/evp_enc.c:95:5: 
  93.   EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
  94.   {
  95. >     return OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  96.   }
  97.   

crypto/mem.c:156:1: start of procedure CRYPTO_zalloc()
    154.   }
    155.   
    156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:158:5: 
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158. >     void *ret = CRYPTO_malloc(num, file, line);
    159.   
    160.       if (ret != NULL)

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
      117.   }
      118.   
      119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121.       void *ret = NULL;

crypto/mem.c:121:5: 
      119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121. >     void *ret = NULL;
      122.   
      123.       if (num <= 0)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (num <= 0)
                     ^
      124.           return NULL;
      125.   

crypto/mem.c:126:5: 
      124.           return NULL;
      125.   
      126. >     allow_customize = 0;
      127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
      134.       }
      135.   #else
      136. >     (void)file;
      137.       (void)line;
      138.       ret = malloc(num);

crypto/mem.c:137:5: 
      135.   #else
      136.       (void)file;
      137. >     (void)line;
      138.       ret = malloc(num);
      139.   #endif

crypto/mem.c:138:5: 
      136.       (void)file;
      137.       (void)line;
      138. >     ret = malloc(num);
      139.   #endif
      140.   

crypto/mem.c:153:5: 
      151.   #endif
      152.   
      153. >     return ret;
      154.   }
      155.   

crypto/mem.c:154:1: return from a call to CRYPTO_malloc
      152.   
      153.       return ret;
      154. > }
      155.   
      156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:160:9: Taking true branch
    158.       void *ret = CRYPTO_malloc(num, file, line);
    159.   
    160.       if (ret != NULL)
                   ^
    161.           memset(ret, 0, num);
    162.       return ret;

crypto/mem.c:161:9: 
    159.   
    160.       if (ret != NULL)
    161. >         memset(ret, 0, num);
    162.       return ret;
    163.   }

crypto/mem.c:162:5: 
    160.       if (ret != NULL)
    161.           memset(ret, 0, num);
    162. >     return ret;
    163.   }
    164.   

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
    161.           memset(ret, 0, num);
    162.       return ret;
    163. > }
    164.   
    165.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/evp_enc.c:96:1: return from a call to EVP_CIPHER_CTX_new
  94.   {
  95.       return OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  96. > }
  97.   
  98.   void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx)

ssl/t1_lib.c:3072:9: Taking false branch
3070.           return -2;
3071.       ctx = EVP_CIPHER_CTX_new();
3072.       if (tctx->tlsext_ticket_key_cb) {
                ^
3073.           unsigned char *nctick = (unsigned char *)etick;
3074.           int rv = tctx->tlsext_ticket_key_cb(s, nctick, nctick + 16,

ssl/t1_lib.c:3084:13: Taking true branch
3082.       } else {
3083.           /* Check key name matches */
3084.           if (memcmp(etick, tctx->tlsext_tick_key_name, 16))
                    ^
3085.               return 2;
3086.           if (HMAC_Init_ex(hctx, tctx->tlsext_tick_hmac_key, 16,

ssl/t1_lib.c:3085:13: 
3083.           /* Check key name matches */
3084.           if (memcmp(etick, tctx->tlsext_tick_key_name, 16))
3085. >             return 2;
3086.           if (HMAC_Init_ex(hctx, tctx->tlsext_tick_hmac_key, 16,
3087.                            EVP_sha256(), NULL) <= 0
