crypto/bio/bss_acpt.c:553: error: MEMORY_LEAK
  memory dynamically allocated by call to `BIO_new()` at line 548, column 11 is not reachable after line 553, column 5.
Showing all 37 steps of the trace


crypto/bio/bss_acpt.c:544:1: start of procedure BIO_new_accept()
542.   }
543.   
544. > BIO *BIO_new_accept(const char *str)
545.   {
546.       BIO *ret;

crypto/bio/bss_acpt.c:548:5: 
546.       BIO *ret;
547.   
548. >     ret = BIO_new(BIO_s_accept());
549.       if (ret == NULL)
550.           return (NULL);

crypto/bio/bss_acpt.c:67:1: start of procedure BIO_s_accept()
  65.   };
  66.   
  67. > const BIO_METHOD *BIO_s_accept(void)
  68.   {
  69.       return (&methods_acceptp);

crypto/bio/bss_acpt.c:69:5: 
  67.   const BIO_METHOD *BIO_s_accept(void)
  68.   {
  69. >     return (&methods_acceptp);
  70.   }
  71.   

crypto/bio/bss_acpt.c:70:1: return from a call to BIO_s_accept
  68.   {
  69.       return (&methods_acceptp);
  70. > }
  71.   
  72.   static int acpt_new(BIO *bi)

crypto/bio/bio_lib.c:17:1: start of procedure BIO_new()
  15.   #include <openssl/stack.h>
  16.   
  17. > BIO *BIO_new(const BIO_METHOD *method)
  18.   {
  19.       BIO *ret = OPENSSL_malloc(sizeof(*ret));

crypto/bio/bio_lib.c:19:5: 
  17.   BIO *BIO_new(const BIO_METHOD *method)
  18.   {
  19. >     BIO *ret = OPENSSL_malloc(sizeof(*ret));
  20.   
  21.       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/bio/bio_lib.c:21:9: Taking false branch
  19.       BIO *ret = OPENSSL_malloc(sizeof(*ret));
  20.   
  21.       if (ret == NULL) {
                ^
  22.           BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
  23.           return (NULL);

crypto/bio/bio_lib.c:25:10: Taking false branch
  23.           return (NULL);
  24.       }
  25.       if (!BIO_set(ret, method)) {
                 ^
  26.           OPENSSL_free(ret);
  27.           ret = NULL;

crypto/bio/bio_lib.c:29:5: 
  27.           ret = NULL;
  28.       }
  29. >     return (ret);
  30.   }
  31.   

crypto/bio/bio_lib.c:30:1: return from a call to BIO_new
  28.       }
  29.       return (ret);
  30. > }
  31.   
  32.   int BIO_set(BIO *bio, const BIO_METHOD *method)

crypto/bio/bss_acpt.c:549:9: Taking false branch
547.   
548.       ret = BIO_new(BIO_s_accept());
549.       if (ret == NULL)
               ^
550.           return (NULL);
551.       if (BIO_set_accept_port(ret, str))

crypto/bio/bss_acpt.c:551:9: 
549.       if (ret == NULL)
550.           return (NULL);
551. >     if (BIO_set_accept_port(ret, str))
552.           return (ret);
553.       BIO_free(ret);

crypto/bio/bio_lib.c:343:1: start of procedure BIO_ctrl()
  341.   }
  342.   
  343. > long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
  344.   {
  345.       long ret;

crypto/bio/bio_lib.c:348:9: Taking false branch
  346.       long (*cb) (BIO *, int, const char *, int, long, long);
  347.   
  348.       if (b == NULL)
                 ^
  349.           return (0);
  350.   

crypto/bio/bio_lib.c:351:10: Taking false branch
  349.           return (0);
  350.   
  351.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
                  ^
  352.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
  353.           return (-2);

crypto/bio/bio_lib.c:351:33: Taking false branch
  349.           return (0);
  350.   
  351.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
                                         ^
  352.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
  353.           return (-2);

crypto/bio/bio_lib.c:356:5: 
  354.       }
  355.   
  356. >     cb = b->callback;
  357.   
  358.       if ((cb != NULL) &&

crypto/bio/bio_lib.c:358:10: Taking true branch
  356.       cb = b->callback;
  357.   
  358.       if ((cb != NULL) &&
                  ^
  359.           ((ret = cb(b, BIO_CB_CTRL, parg, cmd, larg, 1L)) <= 0))
  360.           return (ret);

crypto/bio/bio_lib.c:359:10: Taking false branch
  357.   
  358.       if ((cb != NULL) &&
  359.           ((ret = cb(b, BIO_CB_CTRL, parg, cmd, larg, 1L)) <= 0))
                  ^
  360.           return (ret);
  361.   

crypto/bio/bio_lib.c:362:5: Skipping __function_pointer__(): unresolved function pointer
  360.           return (ret);
  361.   
  362.       ret = b->method->ctrl(b, cmd, larg, parg);
             ^
  363.   
  364.       if (cb != NULL)

crypto/bio/bio_lib.c:364:9: Taking true branch
  362.       ret = b->method->ctrl(b, cmd, larg, parg);
  363.   
  364.       if (cb != NULL)
                 ^
  365.           ret = cb(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, cmd, larg, ret);
  366.       return (ret);

crypto/bio/bio_lib.c:365:9: Skipping __function_pointer__(): unresolved function pointer
  363.   
  364.       if (cb != NULL)
  365.           ret = cb(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, cmd, larg, ret);
                 ^
  366.       return (ret);
  367.   }

crypto/bio/bio_lib.c:366:5: 
  364.       if (cb != NULL)
  365.           ret = cb(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, cmd, larg, ret);
  366. >     return (ret);
  367.   }
  368.   

crypto/bio/bio_lib.c:367:1: return from a call to BIO_ctrl
  365.           ret = cb(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, cmd, larg, ret);
  366.       return (ret);
  367. > }
  368.   
  369.   long BIO_callback_ctrl(BIO *b, int cmd,

crypto/bio/bss_acpt.c:551:9: Taking false branch
549.       if (ret == NULL)
550.           return (NULL);
551.       if (BIO_set_accept_port(ret, str))
               ^
552.           return (ret);
553.       BIO_free(ret);

crypto/bio/bss_acpt.c:553:5: Skipping BIO_free(): empty list of specs
551.       if (BIO_set_accept_port(ret, str))
552.           return (ret);
553.       BIO_free(ret);
           ^
554.       return (NULL);
555.   }

BIO *BIO_new_accept(const char *str)
{
    BIO *ret;
    ret = BIO_new(BIO_s_accept());
    if (ret == NULL)
        return (NULL);
    if (BIO_set_accept_port(ret, str))
        return (ret);
    BIO_free(ret);
    return (NULL);
}
['BIO *BIO_new_accept(const char *str)\n{\n    BIO *ret;\n    ret = BIO_new(BIO_s_accept());\n    if (ret == NULL)\n        return (NULL);\n    if (BIO_set_accept_port(ret, str))\n        return (ret);\n    BIO_free(ret);\n    return (NULL);\n}', 'const BIO_METHOD *BIO_s_accept(void)\n{\n    return (&methods_acceptp);\n}', 'BIO *BIO_new(const BIO_METHOD *method)\n{\n    BIO *ret = OPENSSL_malloc(sizeof(*ret));\n    if (ret == NULL) {\n        BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    if (!BIO_set(ret, method)) {\n        OPENSSL_free(ret);\n        ret = NULL;\n    }\n    return (ret);\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)\n{\n    long ret;\n    long (*cb) (BIO *, int, const char *, int, long, long);\n    if (b == NULL)\n        return (0);\n    if ((b->method == NULL) || (b->method->ctrl == NULL)) {\n        BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);\n        return (-2);\n    }\n    cb = b->callback;\n    if ((cb != NULL) &&\n        ((ret = cb(b, BIO_CB_CTRL, parg, cmd, larg, 1L)) <= 0))\n        return (ret);\n    ret = b->method->ctrl(b, cmd, larg, parg);\n    if (cb != NULL)\n        ret = cb(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, cmd, larg, ret);\n    return (ret);\n}']