crypto/bio/bss_mem.c:155: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `CRYPTO_zalloc()` at line 150, column 23 is not reachable after line 155, column 9.
Showing all 21 steps of the trace


crypto/bio/bss_mem.c:148:1: start of procedure mem_init()
146.   }
147.   
148. > static int mem_init(BIO *bi, unsigned long flags)
149.   {
150.       BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));

crypto/bio/bss_mem.c:150:5: 
148.   static int mem_init(BIO *bi, unsigned long flags)
149.   {
150. >     BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
151.   
152.       if (bb == NULL)

crypto/mem.c:146:1: start of procedure CRYPTO_zalloc()
  144.   }
  145.   
  146. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  147.   {
  148.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:148:5: 
  146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  147.   {
  148. >     void *ret = CRYPTO_malloc(num, file, line);
  149.   
  150.       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 (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    124.           return malloc_impl(num, file, line);
    125.   

crypto/mem.c:126:9: Taking false branch
    124.           return malloc_impl(num, file, line);
    125.   
    126.       if (num <= 0)
                   ^
    127.           return NULL;
    128.   

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

crypto/mem.c:139:5: 
    137.       }
    138.   #else
    139. >     osslargused(file); osslargused(line);
    140.       ret = malloc(num);
    141.   #endif

crypto/mem.c:139:24: 
    137.       }
    138.   #else
    139. >     osslargused(file); osslargused(line);
    140.       ret = malloc(num);
    141.   #endif

crypto/mem.c:140:5: 
    138.   #else
    139.       osslargused(file); osslargused(line);
    140. >     ret = malloc(num);
    141.   #endif
    142.   

crypto/mem.c:143:5: 
    141.   #endif
    142.   
    143. >     return ret;
    144.   }
    145.   

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
    142.   
    143.       return ret;
    144. > }
    145.   
    146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:150:9: Taking true branch
  148.       void *ret = CRYPTO_malloc(num, file, line);
  149.   
  150.       if (ret != NULL)
                 ^
  151.           memset(ret, 0, num);
  152.       return ret;

crypto/mem.c:151:9: 
  149.   
  150.       if (ret != NULL)
  151. >         memset(ret, 0, num);
  152.       return ret;
  153.   }

crypto/mem.c:152:5: 
  150.       if (ret != NULL)
  151.           memset(ret, 0, num);
  152. >     return ret;
  153.   }
  154.   

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

crypto/bio/bss_mem.c:152:9: Taking false branch
150.       BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
151.   
152.       if (bb == NULL)
               ^
153.           return(0);
154.       if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL)

crypto/bio/bss_mem.c:154:9: Taking true branch
152.       if (bb == NULL)
153.           return(0);
154.       if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL)
               ^
155.           return(0);
156.       if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL)

crypto/bio/bss_mem.c:155:9: 
153.           return(0);
154.       if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL)
155. >         return(0);
156.       if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL)
157.           return(0);
