test/bntest.c:634: error: MEMORY_LEAK
  memory dynamically allocated by call to `BN_new()` at line 584, column 9 is not reachable after line 634, column 5.
Showing all 149 steps of the trace


test/bntest.c:577:1: start of procedure test_div_recp()
575.   }
576.   
577. > int test_div_recp(BIO *bp, BN_CTX *ctx)
578.   {
579.       BIGNUM *a, *b, *c, *d, *e;

test/bntest.c:583:5: 
581.       int i;
582.   
583. >     recp = BN_RECP_CTX_new();
584.       a = BN_new();
585.       b = BN_new();

crypto/bn/bn_recp.c:69:1: start of procedure BN_RECP_CTX_new()
  67.   }
  68.   
  69. > BN_RECP_CTX *BN_RECP_CTX_new(void)
  70.   {
  71.       BN_RECP_CTX *ret;

crypto/bn/bn_recp.c:73:9: 
  71.       BN_RECP_CTX *ret;
  72.   
  73. >     if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  74.           return (NULL);
  75.   

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/bn/bn_recp.c:73:9: Taking false branch
  71.       BN_RECP_CTX *ret;
  72.   
  73.       if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
                ^
  74.           return (NULL);
  75.   

crypto/bn/bn_recp.c:76:5: 
  74.           return (NULL);
  75.   
  76. >     BN_RECP_CTX_init(ret);
  77.       ret->flags = BN_FLG_MALLOCED;
  78.       return (ret);

crypto/bn/bn_recp.c:61:1: start of procedure BN_RECP_CTX_init()
    59.   #include "bn_lcl.h"
    60.   
    61. > void BN_RECP_CTX_init(BN_RECP_CTX *recp)
    62.   {
    63.       bn_init(&(recp->N));

crypto/bn/bn_recp.c:63:5: Skipping bn_init(): empty list of specs
    61.   void BN_RECP_CTX_init(BN_RECP_CTX *recp)
    62.   {
    63.       bn_init(&(recp->N));
              ^
    64.       bn_init(&(recp->Nr));
    65.       recp->num_bits = 0;

crypto/bn/bn_recp.c:64:5: Skipping bn_init(): empty list of specs
    62.   {
    63.       bn_init(&(recp->N));
    64.       bn_init(&(recp->Nr));
              ^
    65.       recp->num_bits = 0;
    66.       recp->flags = 0;

crypto/bn/bn_recp.c:65:5: 
    63.       bn_init(&(recp->N));
    64.       bn_init(&(recp->Nr));
    65. >     recp->num_bits = 0;
    66.       recp->flags = 0;
    67.   }

crypto/bn/bn_recp.c:66:5: 
    64.       bn_init(&(recp->Nr));
    65.       recp->num_bits = 0;
    66. >     recp->flags = 0;
    67.   }
    68.   

crypto/bn/bn_recp.c:67:1: return from a call to BN_RECP_CTX_init
    65.       recp->num_bits = 0;
    66.       recp->flags = 0;
    67. > }
    68.   
    69.   BN_RECP_CTX *BN_RECP_CTX_new(void)

crypto/bn/bn_recp.c:77:5: 
  75.   
  76.       BN_RECP_CTX_init(ret);
  77. >     ret->flags = BN_FLG_MALLOCED;
  78.       return (ret);
  79.   }

crypto/bn/bn_recp.c:78:5: 
  76.       BN_RECP_CTX_init(ret);
  77.       ret->flags = BN_FLG_MALLOCED;
  78. >     return (ret);
  79.   }
  80.   

crypto/bn/bn_recp.c:79:1: return from a call to BN_RECP_CTX_new
  77.       ret->flags = BN_FLG_MALLOCED;
  78.       return (ret);
  79. > }
  80.   
  81.   void BN_RECP_CTX_free(BN_RECP_CTX *recp)

test/bntest.c:584:5: 
582.   
583.       recp = BN_RECP_CTX_new();
584. >     a = BN_new();
585.       b = BN_new();
586.       c = BN_new();

crypto/bn/bn_lib.c:276:1: start of procedure BN_new()
  274.   }
  275.   
  276. > BIGNUM *BN_new(void)
  277.   {
  278.       BIGNUM *ret;

crypto/bn/bn_lib.c:280:9: 
  278.       BIGNUM *ret;
  279.   
  280. >     if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (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/bn/bn_lib.c:280:9: Taking false branch
  278.       BIGNUM *ret;
  279.   
  280.       if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
                 ^
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (NULL);

crypto/bn/bn_lib.c:284:5: 
  282.           return (NULL);
  283.       }
  284. >     ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286.       return (ret);

crypto/bn/bn_lib.c:286:5: 
  284.       ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286. >     return (ret);
  287.   }
  288.   

crypto/bn/bn_lib.c:287:1: return from a call to BN_new
  285.       bn_check_top(ret);
  286.       return (ret);
  287. > }
  288.   
  289.    BIGNUM *BN_secure_new(void)

test/bntest.c:585:5: 
583.       recp = BN_RECP_CTX_new();
584.       a = BN_new();
585. >     b = BN_new();
586.       c = BN_new();
587.       d = BN_new();

crypto/bn/bn_lib.c:276:1: start of procedure BN_new()
  274.   }
  275.   
  276. > BIGNUM *BN_new(void)
  277.   {
  278.       BIGNUM *ret;

crypto/bn/bn_lib.c:280:9: 
  278.       BIGNUM *ret;
  279.   
  280. >     if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (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/bn/bn_lib.c:280:9: Taking false branch
  278.       BIGNUM *ret;
  279.   
  280.       if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
                 ^
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (NULL);

crypto/bn/bn_lib.c:284:5: 
  282.           return (NULL);
  283.       }
  284. >     ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286.       return (ret);

crypto/bn/bn_lib.c:286:5: 
  284.       ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286. >     return (ret);
  287.   }
  288.   

crypto/bn/bn_lib.c:287:1: return from a call to BN_new
  285.       bn_check_top(ret);
  286.       return (ret);
  287. > }
  288.   
  289.    BIGNUM *BN_secure_new(void)

test/bntest.c:586:5: 
584.       a = BN_new();
585.       b = BN_new();
586. >     c = BN_new();
587.       d = BN_new();
588.       e = BN_new();

crypto/bn/bn_lib.c:276:1: start of procedure BN_new()
  274.   }
  275.   
  276. > BIGNUM *BN_new(void)
  277.   {
  278.       BIGNUM *ret;

crypto/bn/bn_lib.c:280:9: 
  278.       BIGNUM *ret;
  279.   
  280. >     if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (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/bn/bn_lib.c:280:9: Taking false branch
  278.       BIGNUM *ret;
  279.   
  280.       if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
                 ^
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (NULL);

crypto/bn/bn_lib.c:284:5: 
  282.           return (NULL);
  283.       }
  284. >     ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286.       return (ret);

crypto/bn/bn_lib.c:286:5: 
  284.       ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286. >     return (ret);
  287.   }
  288.   

crypto/bn/bn_lib.c:287:1: return from a call to BN_new
  285.       bn_check_top(ret);
  286.       return (ret);
  287. > }
  288.   
  289.    BIGNUM *BN_secure_new(void)

test/bntest.c:587:5: 
585.       b = BN_new();
586.       c = BN_new();
587. >     d = BN_new();
588.       e = BN_new();
589.   

crypto/bn/bn_lib.c:276:1: start of procedure BN_new()
  274.   }
  275.   
  276. > BIGNUM *BN_new(void)
  277.   {
  278.       BIGNUM *ret;

crypto/bn/bn_lib.c:280:9: 
  278.       BIGNUM *ret;
  279.   
  280. >     if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (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/bn/bn_lib.c:280:9: Taking false branch
  278.       BIGNUM *ret;
  279.   
  280.       if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
                 ^
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (NULL);

crypto/bn/bn_lib.c:284:5: 
  282.           return (NULL);
  283.       }
  284. >     ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286.       return (ret);

crypto/bn/bn_lib.c:286:5: 
  284.       ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286. >     return (ret);
  287.   }
  288.   

crypto/bn/bn_lib.c:287:1: return from a call to BN_new
  285.       bn_check_top(ret);
  286.       return (ret);
  287. > }
  288.   
  289.    BIGNUM *BN_secure_new(void)

test/bntest.c:588:5: 
586.       c = BN_new();
587.       d = BN_new();
588. >     e = BN_new();
589.   
590.       for (i = 0; i < num0 + num1; i++) {

crypto/bn/bn_lib.c:276:1: start of procedure BN_new()
  274.   }
  275.   
  276. > BIGNUM *BN_new(void)
  277.   {
  278.       BIGNUM *ret;

crypto/bn/bn_lib.c:280:9: 
  278.       BIGNUM *ret;
  279.   
  280. >     if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (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/bn/bn_lib.c:280:9: Taking false branch
  278.       BIGNUM *ret;
  279.   
  280.       if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
                 ^
  281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  282.           return (NULL);

crypto/bn/bn_lib.c:284:5: 
  282.           return (NULL);
  283.       }
  284. >     ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286.       return (ret);

crypto/bn/bn_lib.c:286:5: 
  284.       ret->flags = BN_FLG_MALLOCED;
  285.       bn_check_top(ret);
  286. >     return (ret);
  287.   }
  288.   

crypto/bn/bn_lib.c:287:1: return from a call to BN_new
  285.       bn_check_top(ret);
  286.       return (ret);
  287. > }
  288.   
  289.    BIGNUM *BN_secure_new(void)

test/bntest.c:590:10: 
588.       e = BN_new();
589.   
590. >     for (i = 0; i < num0 + num1; i++) {
591.           if (i < num1) {
592.               BN_bntest_rand(a, 400, 0, 0);

test/bntest.c:590:17: Loop condition is false. Leaving loop
588.       e = BN_new();
589.   
590.       for (i = 0; i < num0 + num1; i++) {
                       ^
591.           if (i < num1) {
592.               BN_bntest_rand(a, 400, 0, 0);

test/bntest.c:634:5: 
632.           }
633.       }
634. >     BN_free(a);
635.       BN_free(b);
636.       BN_free(c);

crypto/bn/bn_lib.c:251:1: start of procedure BN_free()
  249.   }
  250.   
  251. > void BN_free(BIGNUM *a)
  252.   {
  253.       if (a == NULL)

crypto/bn/bn_lib.c:253:9: Taking false branch
  251.   void BN_free(BIGNUM *a)
  252.   {
  253.       if (a == NULL)
                 ^
  254.           return;
  255.       bn_check_top(a);

crypto/bn/bn_lib.c:256:10: 
  254.           return;
  255.       bn_check_top(a);
  256. >     if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  257.           bn_free_d(a);
  258.       if (a->flags & BN_FLG_MALLOCED)

crypto/bn/bn_lib.c:955:1: start of procedure BN_get_flags()
    953.   }
    954.   
    955. > int BN_get_flags(const BIGNUM *b, int n)
    956.   {
    957.       return b->flags & n;

crypto/bn/bn_lib.c:957:5: 
    955.   int BN_get_flags(const BIGNUM *b, int n)
    956.   {
    957. >     return b->flags & n;
    958.   }
    959.   

crypto/bn/bn_lib.c:958:1: return from a call to BN_get_flags
    956.   {
    957.       return b->flags & n;
    958. > }
    959.   
    960.   /* Populate a BN_GENCB structure with an "old"-style callback */

crypto/bn/bn_lib.c:256:10: Taking false branch
  254.           return;
  255.       bn_check_top(a);
  256.       if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
                  ^
  257.           bn_free_d(a);
  258.       if (a->flags & BN_FLG_MALLOCED)

crypto/bn/bn_lib.c:258:9: Taking false branch
  256.       if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  257.           bn_free_d(a);
  258.       if (a->flags & BN_FLG_MALLOCED)
                 ^
  259.           OPENSSL_free(a);
  260.       else {

crypto/bn/bn_lib.c:262:9: 
  260.       else {
  261.   #if OPENSSL_API_COMPAT < 0x00908000L
  262. >         a->flags |= BN_FLG_FREE;
  263.   #endif
  264.           a->d = NULL;

crypto/bn/bn_lib.c:264:9: 
  262.           a->flags |= BN_FLG_FREE;
  263.   #endif
  264. >         a->d = NULL;
  265.       }
  266.   }

crypto/bn/bn_lib.c:258:5: 
  256.       if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  257.           bn_free_d(a);
  258. >     if (a->flags & BN_FLG_MALLOCED)
  259.           OPENSSL_free(a);
  260.       else {

crypto/bn/bn_lib.c:266:1: return from a call to BN_free
  264.           a->d = NULL;
  265.       }
  266. > }
  267.   
  268.   void bn_init(BIGNUM *a)

int test_div_recp(BIO *bp, BN_CTX *ctx)
{
    BIGNUM *a, *b, *c, *d, *e;
    BN_RECP_CTX *recp;
    int i;
    recp = BN_RECP_CTX_new();
    a = BN_new();
    b = BN_new();
    c = BN_new();
    d = BN_new();
    e = BN_new();
    for (i = 0; i < num0 + num1; i++) {
        if (i < num1) {
            BN_bntest_rand(a, 400, 0, 0);
            BN_copy(b, a);
            BN_lshift(a, a, i);
            BN_add_word(a, i);
        } else
            BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0);
        a->neg = rand_neg();
        b->neg = rand_neg();
        BN_RECP_CTX_set(recp, b, ctx);
        BN_div_recp(d, c, a, recp, ctx);
        if (bp != NULL) {
            if (!results) {
                BN_print(bp, a);
                BIO_puts(bp, " / ");
                BN_print(bp, b);
                BIO_puts(bp, " - ");
            }
            BN_print(bp, d);
            BIO_puts(bp, "\n");
            if (!results) {
                BN_print(bp, a);
                BIO_puts(bp, " % ");
                BN_print(bp, b);
                BIO_puts(bp, " - ");
            }
            BN_print(bp, c);
            BIO_puts(bp, "\n");
        }
        BN_mul(e, d, b, ctx);
        BN_add(d, e, c);
        BN_sub(d, d, a);
        if (!BN_is_zero(d)) {
            fprintf(stderr, "Reciprocal division test failed!\n");
            fprintf(stderr, "a=");
            BN_print_fp(stderr, a);
            fprintf(stderr, "\nb=");
            BN_print_fp(stderr, b);
            fprintf(stderr, "\n");
            return 0;
        }
    }
    BN_free(a);
    BN_free(b);
    BN_free(c);
    BN_free(d);
    BN_free(e);
    BN_RECP_CTX_free(recp);
    return (1);
}
['int test_div_recp(BIO *bp, BN_CTX *ctx)\n{\n    BIGNUM *a, *b, *c, *d, *e;\n    BN_RECP_CTX *recp;\n    int i;\n    recp = BN_RECP_CTX_new();\n    a = BN_new();\n    b = BN_new();\n    c = BN_new();\n    d = BN_new();\n    e = BN_new();\n    for (i = 0; i < num0 + num1; i++) {\n        if (i < num1) {\n            BN_bntest_rand(a, 400, 0, 0);\n            BN_copy(b, a);\n            BN_lshift(a, a, i);\n            BN_add_word(a, i);\n        } else\n            BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0);\n        a->neg = rand_neg();\n        b->neg = rand_neg();\n        BN_RECP_CTX_set(recp, b, ctx);\n        BN_div_recp(d, c, a, recp, ctx);\n        if (bp != NULL) {\n            if (!results) {\n                BN_print(bp, a);\n                BIO_puts(bp, " / ");\n                BN_print(bp, b);\n                BIO_puts(bp, " - ");\n            }\n            BN_print(bp, d);\n            BIO_puts(bp, "\\n");\n            if (!results) {\n                BN_print(bp, a);\n                BIO_puts(bp, " % ");\n                BN_print(bp, b);\n                BIO_puts(bp, " - ");\n            }\n            BN_print(bp, c);\n            BIO_puts(bp, "\\n");\n        }\n        BN_mul(e, d, b, ctx);\n        BN_add(d, e, c);\n        BN_sub(d, d, a);\n        if (!BN_is_zero(d)) {\n            fprintf(stderr, "Reciprocal division test failed!\\n");\n            fprintf(stderr, "a=");\n            BN_print_fp(stderr, a);\n            fprintf(stderr, "\\nb=");\n            BN_print_fp(stderr, b);\n            fprintf(stderr, "\\n");\n            return 0;\n        }\n    }\n    BN_free(a);\n    BN_free(b);\n    BN_free(c);\n    BN_free(d);\n    BN_free(e);\n    BN_RECP_CTX_free(recp);\n    return (1);\n}', 'BN_RECP_CTX *BN_RECP_CTX_new(void)\n{\n    BN_RECP_CTX *ret;\n    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)\n        return (NULL);\n    BN_RECP_CTX_init(ret);\n    ret->flags = BN_FLG_MALLOCED;\n    return (ret);\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\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    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'void BN_RECP_CTX_init(BN_RECP_CTX *recp)\n{\n    bn_init(&(recp->N));\n    bn_init(&(recp->Nr));\n    recp->num_bits = 0;\n    recp->flags = 0;\n}', 'BIGNUM *BN_new(void)\n{\n    BIGNUM *ret;\n    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {\n        BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    ret->flags = BN_FLG_MALLOCED;\n    bn_check_top(ret);\n    return (ret);\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void BN_free(BIGNUM *a)\n{\n    if (a == NULL)\n        return;\n    bn_check_top(a);\n    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))\n        bn_free_d(a);\n    if (a->flags & BN_FLG_MALLOCED)\n        OPENSSL_free(a);\n    else {\n#if OPENSSL_API_COMPAT < 0x00908000L\n        a->flags |= BN_FLG_FREE;\n#endif\n        a->d = NULL;\n    }\n}', 'int BN_get_flags(const BIGNUM *b, int n)\n{\n    return b->flags & n;\n}']