ssl/ssl_rsa.c:279: error: MEMORY_LEAK
  memory dynamically allocated by call to `BIO_new()` at line 249, column 10 is not reachable after line 279, column 5.
Showing all 41 steps of the trace


ssl/ssl_rsa.c:243:1: start of procedure SSL_use_PrivateKey_file()
241.   
242.   #ifndef OPENSSL_NO_STDIO
243. > int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type)
244.   {
245.       int j, ret = 0;

ssl/ssl_rsa.c:245:5: 
243.   int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type)
244.   {
245. >     int j, ret = 0;
246.       BIO *in;
247.       EVP_PKEY *pkey = NULL;

ssl/ssl_rsa.c:247:5: 
245.       int j, ret = 0;
246.       BIO *in;
247. >     EVP_PKEY *pkey = NULL;
248.   
249.       in = BIO_new(BIO_s_file());

ssl/ssl_rsa.c:249:5: 
247.       EVP_PKEY *pkey = NULL;
248.   
249. >     in = BIO_new(BIO_s_file());
250.       if (in == NULL) {
251.           SSLerr(SSL_F_SSL_USE_PRIVATEKEY_FILE, ERR_R_BUF_LIB);

crypto/bio/bss_file.c:106:1: start of procedure BIO_s_file()
  104.   }
  105.   
  106. > const BIO_METHOD *BIO_s_file(void)
  107.   {
  108.       return (&methods_filep);

crypto/bio/bss_file.c:108:5: 
  106.   const BIO_METHOD *BIO_s_file(void)
  107.   {
  108. >     return (&methods_filep);
  109.   }
  110.   

crypto/bio/bss_file.c:109:1: return from a call to BIO_s_file
  107.   {
  108.       return (&methods_filep);
  109. > }
  110.   
  111.   static int file_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)

ssl/ssl_rsa.c:250:9: Taking false branch
248.   
249.       in = BIO_new(BIO_s_file());
250.       if (in == NULL) {
               ^
251.           SSLerr(SSL_F_SSL_USE_PRIVATEKEY_FILE, ERR_R_BUF_LIB);
252.           goto end;

ssl/ssl_rsa.c:255:9: 
253.       }
254.   
255. >     if (BIO_read_filename(in, file) <= 0) {
256.           SSLerr(SSL_F_SSL_USE_PRIVATEKEY_FILE, ERR_R_SYS_LIB);
257.           goto end;

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,

ssl/ssl_rsa.c:255:9: Taking true branch
253.       }
254.   
255.       if (BIO_read_filename(in, file) <= 0) {
               ^
256.           SSLerr(SSL_F_SSL_USE_PRIVATEKEY_FILE, ERR_R_SYS_LIB);
257.           goto end;

ssl/ssl_rsa.c:256:9: Skipping ERR_put_error(): empty list of specs
254.   
255.       if (BIO_read_filename(in, file) <= 0) {
256.           SSLerr(SSL_F_SSL_USE_PRIVATEKEY_FILE, ERR_R_SYS_LIB);
               ^
257.           goto end;
258.       }

ssl/ssl_rsa.c:278:2: 
276.       ret = SSL_use_PrivateKey(ssl, pkey);
277.       EVP_PKEY_free(pkey);
278. >  end:
279.       BIO_free(in);
280.       return (ret);

ssl/ssl_rsa.c:279:5: Skipping BIO_free(): empty list of specs
277.       EVP_PKEY_free(pkey);
278.    end:
279.       BIO_free(in);
           ^
280.       return (ret);
281.   }
