crypto/srp/srp_lib.c:170: error: MEMORY_LEAK
  memory dynamically allocated by call to `BN_new()` at line 157, column 16 is not reachable after line 170, column 5.
Showing all 127 steps of the trace


crypto/srp/srp_lib.c:147:1: start of procedure SRP_Calc_server_key()
145.   }
146.   
147. > BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,
148.                               BIGNUM *N)
149.   {

crypto/srp/srp_lib.c:150:5: 
148.                               BIGNUM *N)
149.   {
150. >     BIGNUM *tmp = NULL, *S = NULL;
151.       BN_CTX *bn_ctx;
152.   

crypto/srp/srp_lib.c:153:9: Taking false branch
151.       BN_CTX *bn_ctx;
152.   
153.       if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL)
               ^
154.           return NULL;
155.   

crypto/srp/srp_lib.c:153:22: Taking false branch
151.       BN_CTX *bn_ctx;
152.   
153.       if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL)
                            ^
154.           return NULL;
155.   

crypto/srp/srp_lib.c:153:35: Taking false branch
151.       BN_CTX *bn_ctx;
152.   
153.       if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL)
                                         ^
154.           return NULL;
155.   

crypto/srp/srp_lib.c:153:48: Taking false branch
151.       BN_CTX *bn_ctx;
152.   
153.       if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL)
                                                      ^
154.           return NULL;
155.   

crypto/srp/srp_lib.c:153:61: Taking false branch
151.       BN_CTX *bn_ctx;
152.   
153.       if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL)
                                                                   ^
154.           return NULL;
155.   

crypto/srp/srp_lib.c:156:9: 
154.           return NULL;
155.   
156. >     if ((bn_ctx = BN_CTX_new()) == NULL ||
157.           (tmp = BN_new()) == NULL || (S = BN_new()) == NULL)
158.           goto err;

crypto/bn/bn_ctx.c:188:1: start of procedure BN_CTX_new()
  186.   
  187.   
  188. > BN_CTX *BN_CTX_new(void)
  189.   {
  190.       BN_CTX *ret;

crypto/bn/bn_ctx.c:192:9: 
  190.       BN_CTX *ret;
  191.   
  192. >     if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
  193.           BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);
  194.           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_ctx.c:192:9: Taking false branch
  190.       BN_CTX *ret;
  191.   
  192.       if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
                 ^
  193.           BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);
  194.           return NULL;

crypto/bn/bn_ctx.c:197:5: 
  195.       }
  196.       /* Initialise the structure */
  197. >     BN_POOL_init(&ret->pool);
  198.       BN_STACK_init(&ret->stack);
  199.       return ret;

crypto/bn/bn_ctx.c:334:1: start of procedure BN_POOL_init()
    332.   /***********/
    333.   
    334. > static void BN_POOL_init(BN_POOL *p)
    335.   {
    336.       p->head = p->current = p->tail = NULL;

crypto/bn/bn_ctx.c:336:5: 
    334.   static void BN_POOL_init(BN_POOL *p)
    335.   {
    336. >     p->head = p->current = p->tail = NULL;
    337.       p->used = p->size = 0;
    338.   }

crypto/bn/bn_ctx.c:337:5: 
    335.   {
    336.       p->head = p->current = p->tail = NULL;
    337. >     p->used = p->size = 0;
    338.   }
    339.   

crypto/bn/bn_ctx.c:338:1: return from a call to BN_POOL_init
    336.       p->head = p->current = p->tail = NULL;
    337.       p->used = p->size = 0;
    338. > }
    339.   
    340.   static void BN_POOL_finish(BN_POOL *p)

crypto/bn/bn_ctx.c:198:5: 
  196.       /* Initialise the structure */
  197.       BN_POOL_init(&ret->pool);
  198. >     BN_STACK_init(&ret->stack);
  199.       return ret;
  200.   }

crypto/bn/bn_ctx.c:293:1: start of procedure BN_STACK_init()
    291.   /************/
    292.   
    293. > static void BN_STACK_init(BN_STACK *st)
    294.   {
    295.       st->indexes = NULL;

crypto/bn/bn_ctx.c:295:5: 
    293.   static void BN_STACK_init(BN_STACK *st)
    294.   {
    295. >     st->indexes = NULL;
    296.       st->depth = st->size = 0;
    297.   }

crypto/bn/bn_ctx.c:296:5: 
    294.   {
    295.       st->indexes = NULL;
    296. >     st->depth = st->size = 0;
    297.   }
    298.   

crypto/bn/bn_ctx.c:297:1: return from a call to BN_STACK_init
    295.       st->indexes = NULL;
    296.       st->depth = st->size = 0;
    297. > }
    298.   
    299.   static void BN_STACK_finish(BN_STACK *st)

crypto/bn/bn_ctx.c:199:5: 
  197.       BN_POOL_init(&ret->pool);
  198.       BN_STACK_init(&ret->stack);
  199. >     return ret;
  200.   }
  201.   

crypto/bn/bn_ctx.c:200:1: return from a call to BN_CTX_new
  198.       BN_STACK_init(&ret->stack);
  199.       return ret;
  200. > }
  201.   
  202.   BN_CTX *BN_CTX_secure_new(void)

crypto/srp/srp_lib.c:156:9: Taking false branch
154.           return NULL;
155.   
156.       if ((bn_ctx = BN_CTX_new()) == NULL ||
               ^
157.           (tmp = BN_new()) == NULL || (S = BN_new()) == NULL)
158.           goto err;

crypto/srp/srp_lib.c:157:9: 
155.   
156.       if ((bn_ctx = BN_CTX_new()) == NULL ||
157. >         (tmp = BN_new()) == NULL || (S = BN_new()) == NULL)
158.           goto err;
159.   

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)

crypto/srp/srp_lib.c:157:9: Taking false branch
155.   
156.       if ((bn_ctx = BN_CTX_new()) == NULL ||
157.           (tmp = BN_new()) == NULL || (S = BN_new()) == NULL)
               ^
158.           goto err;
159.   

crypto/srp/srp_lib.c:157:37: 
155.   
156.       if ((bn_ctx = BN_CTX_new()) == NULL ||
157. >         (tmp = BN_new()) == NULL || (S = BN_new()) == NULL)
158.           goto err;
159.   

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)

crypto/srp/srp_lib.c:157:37: Taking false branch
155.   
156.       if ((bn_ctx = BN_CTX_new()) == NULL ||
157.           (tmp = BN_new()) == NULL || (S = BN_new()) == NULL)
                                           ^
158.           goto err;
159.   

crypto/srp/srp_lib.c:162:10: Taking false branch
160.       /* S = (A*v**u) ** b */
161.   
162.       if (!BN_mod_exp(tmp, v, u, N, bn_ctx))
                ^
163.           goto err;
164.       if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx))

crypto/srp/srp_lib.c:164:10: Taking false branch
162.       if (!BN_mod_exp(tmp, v, u, N, bn_ctx))
163.           goto err;
164.       if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx))
                ^
165.           goto err;
166.       if (!BN_mod_exp(S, tmp, b, N, bn_ctx))

crypto/srp/srp_lib.c:166:10: Taking true branch
164.       if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx))
165.           goto err;
166.       if (!BN_mod_exp(S, tmp, b, N, bn_ctx))
                ^
167.           goto err;
168.    err:

crypto/srp/srp_lib.c:168:2: 
166.       if (!BN_mod_exp(S, tmp, b, N, bn_ctx))
167.           goto err;
168. >  err:
169.       BN_CTX_free(bn_ctx);
170.       BN_clear_free(tmp);

crypto/srp/srp_lib.c:169:5: 
167.           goto err;
168.    err:
169. >     BN_CTX_free(bn_ctx);
170.       BN_clear_free(tmp);
171.       return S;

crypto/bn/bn_ctx.c:211:1: start of procedure BN_CTX_free()
  209.   }
  210.   
  211. > void BN_CTX_free(BN_CTX *ctx)
  212.   {
  213.       if (ctx == NULL)

crypto/bn/bn_ctx.c:213:9: Taking false branch
  211.   void BN_CTX_free(BN_CTX *ctx)
  212.   {
  213.       if (ctx == NULL)
                 ^
  214.           return;
  215.   #ifdef BN_CTX_DEBUG

crypto/bn/bn_ctx.c:230:5: 
  228.       }
  229.   #endif
  230. >     BN_STACK_finish(&ctx->stack);
  231.       BN_POOL_finish(&ctx->pool);
  232.       OPENSSL_free(ctx);

crypto/bn/bn_ctx.c:299:1: start of procedure BN_STACK_finish()
    297.   }
    298.   
    299. > static void BN_STACK_finish(BN_STACK *st)
    300.   {
    301.       OPENSSL_free(st->indexes);

crypto/bn/bn_ctx.c:301:5: 
    299.   static void BN_STACK_finish(BN_STACK *st)
    300.   {
    301. >     OPENSSL_free(st->indexes);
    302.       st->indexes = NULL;
    303.   }

crypto/mem.c:233:1: start of procedure CRYPTO_free()
      231.   }
      232.   
      233. > void CRYPTO_free(void *str)
      234.   {
      235.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:244:5: 
      242.       }
      243.   #else
      244. >     free(str);
      245.   #endif
      246.   }

crypto/mem.c:246:1: return from a call to CRYPTO_free
      244.       free(str);
      245.   #endif
      246. > }
      247.   
      248.   void CRYPTO_clear_free(void *str, size_t num)

crypto/bn/bn_ctx.c:302:5: 
    300.   {
    301.       OPENSSL_free(st->indexes);
    302. >     st->indexes = NULL;
    303.   }
    304.   

crypto/bn/bn_ctx.c:303:1: return from a call to BN_STACK_finish
    301.       OPENSSL_free(st->indexes);
    302.       st->indexes = NULL;
    303. > }
    304.   
    305.   

crypto/bn/bn_ctx.c:231:5: 
  229.   #endif
  230.       BN_STACK_finish(&ctx->stack);
  231. >     BN_POOL_finish(&ctx->pool);
  232.       OPENSSL_free(ctx);
  233.   }

crypto/bn/bn_ctx.c:340:1: start of procedure BN_POOL_finish()
    338.   }
    339.   
    340. > static void BN_POOL_finish(BN_POOL *p)
    341.   {
    342.       unsigned int loop;

crypto/bn/bn_ctx.c:345:12: Loop condition is false. Leaving loop
    343.       BIGNUM *bn;
    344.   
    345.       while (p->head) {
                      ^
    346.           for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++)
    347.               if (bn->d)

crypto/bn/bn_ctx.c:353:1: return from a call to BN_POOL_finish
    351.           p->head = p->current;
    352.       }
    353. > }
    354.   
    355.   

crypto/bn/bn_ctx.c:232:5: 
  230.       BN_STACK_finish(&ctx->stack);
  231.       BN_POOL_finish(&ctx->pool);
  232. >     OPENSSL_free(ctx);
  233.   }
  234.   

crypto/mem.c:233:1: start of procedure CRYPTO_free()
    231.   }
    232.   
    233. > void CRYPTO_free(void *str)
    234.   {
    235.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:244:5: 
    242.       }
    243.   #else
    244. >     free(str);
    245.   #endif
    246.   }

crypto/mem.c:246:1: return from a call to CRYPTO_free
    244.       free(str);
    245.   #endif
    246. > }
    247.   
    248.   void CRYPTO_clear_free(void *str, size_t num)

crypto/bn/bn_ctx.c:233:1: return from a call to BN_CTX_free
  231.       BN_POOL_finish(&ctx->pool);
  232.       OPENSSL_free(ctx);
  233. > }
  234.   
  235.   void BN_CTX_start(BN_CTX *ctx)

crypto/srp/srp_lib.c:170:5: 
168.    err:
169.       BN_CTX_free(bn_ctx);
170. >     BN_clear_free(tmp);
171.       return S;
172.   }

crypto/bn/bn_lib.c:233:1: start of procedure BN_clear_free()
  231.   
  232.   
  233. > void BN_clear_free(BIGNUM *a)
  234.   {
  235.       int i;

crypto/bn/bn_lib.c:237:9: Taking false branch
  235.       int i;
  236.   
  237.       if (a == NULL)
                 ^
  238.           return;
  239.       bn_check_top(a);

crypto/bn/bn_lib.c:240:9: Taking true branch
  238.           return;
  239.       bn_check_top(a);
  240.       if (a->d != NULL) {
                 ^
  241.           OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0]));
  242.           if (!BN_get_flags(a, BN_FLG_STATIC_DATA))

crypto/bn/bn_lib.c:241:9: Skipping OPENSSL_cleanse(): method has no implementation
  239.       bn_check_top(a);
  240.       if (a->d != NULL) {
  241.           OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0]));
                 ^
  242.           if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  243.               bn_free_d(a);

crypto/bn/bn_lib.c:242:14: 
  240.       if (a->d != NULL) {
  241.           OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0]));
  242. >         if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  243.               bn_free_d(a);
  244.       }

crypto/bn/bn_lib.c:964:1: start of procedure BN_get_flags()
    962.   }
    963.   
    964. > int BN_get_flags(const BIGNUM *b, int n)
    965.   {
    966.       return b->flags & n;

crypto/bn/bn_lib.c:966:5: 
    964.   int BN_get_flags(const BIGNUM *b, int n)
    965.   {
    966. >     return b->flags & n;
    967.   }
    968.   

crypto/bn/bn_lib.c:967:1: return from a call to BN_get_flags
    965.   {
    966.       return b->flags & n;
    967. > }
    968.   
    969.   /* Populate a BN_GENCB structure with an "old"-style callback */

crypto/bn/bn_lib.c:242:14: Taking false branch
  240.       if (a->d != NULL) {
  241.           OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0]));
  242.           if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
                      ^
  243.               bn_free_d(a);
  244.       }

crypto/bn/bn_lib.c:245:5: 
  243.               bn_free_d(a);
  244.       }
  245. >     i = BN_get_flags(a, BN_FLG_MALLOCED);
  246.       OPENSSL_cleanse(a, sizeof(*a));
  247.       if (i)

crypto/bn/bn_lib.c:964:1: start of procedure BN_get_flags()
    962.   }
    963.   
    964. > int BN_get_flags(const BIGNUM *b, int n)
    965.   {
    966.       return b->flags & n;

crypto/bn/bn_lib.c:966:5: 
    964.   int BN_get_flags(const BIGNUM *b, int n)
    965.   {
    966. >     return b->flags & n;
    967.   }
    968.   

crypto/bn/bn_lib.c:967:1: return from a call to BN_get_flags
    965.   {
    966.       return b->flags & n;
    967. > }
    968.   
    969.   /* Populate a BN_GENCB structure with an "old"-style callback */

crypto/bn/bn_lib.c:246:5: Skipping OPENSSL_cleanse(): method has no implementation
  244.       }
  245.       i = BN_get_flags(a, BN_FLG_MALLOCED);
  246.       OPENSSL_cleanse(a, sizeof(*a));
             ^
  247.       if (i)
  248.           OPENSSL_free(a);

crypto/bn/bn_lib.c:247:9: Taking false branch
  245.       i = BN_get_flags(a, BN_FLG_MALLOCED);
  246.       OPENSSL_cleanse(a, sizeof(*a));
  247.       if (i)
                 ^
  248.           OPENSSL_free(a);
  249.   }

crypto/bn/bn_lib.c:247:5: 
  245.       i = BN_get_flags(a, BN_FLG_MALLOCED);
  246.       OPENSSL_cleanse(a, sizeof(*a));
  247. >     if (i)
  248.           OPENSSL_free(a);
  249.   }

crypto/bn/bn_lib.c:249:1: return from a call to BN_clear_free
  247.       if (i)
  248.           OPENSSL_free(a);
  249. > }
  250.   
  251.   void BN_free(BIGNUM *a)

BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,
                            BIGNUM *N)
{
    BIGNUM *tmp = NULL, *S = NULL;
    BN_CTX *bn_ctx;
    if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL)
        return NULL;
    if ((bn_ctx = BN_CTX_new()) == NULL ||
        (tmp = BN_new()) == NULL || (S = BN_new()) == NULL)
        goto err;
    if (!BN_mod_exp(tmp, v, u, N, bn_ctx))
        goto err;
    if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx))
        goto err;
    if (!BN_mod_exp(S, tmp, b, N, bn_ctx))
        goto err;
 err:
    BN_CTX_free(bn_ctx);
    BN_clear_free(tmp);
    return S;
}
['BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,\n                            BIGNUM *N)\n{\n    BIGNUM *tmp = NULL, *S = NULL;\n    BN_CTX *bn_ctx;\n    if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL)\n        return NULL;\n    if ((bn_ctx = BN_CTX_new()) == NULL ||\n        (tmp = BN_new()) == NULL || (S = BN_new()) == NULL)\n        goto err;\n    if (!BN_mod_exp(tmp, v, u, N, bn_ctx))\n        goto err;\n    if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx))\n        goto err;\n    if (!BN_mod_exp(S, tmp, b, N, bn_ctx))\n        goto err;\n err:\n    BN_CTX_free(bn_ctx);\n    BN_clear_free(tmp);\n    return S;\n}', 'BN_CTX *BN_CTX_new(void)\n{\n    BN_CTX *ret;\n    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {\n        BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);\n        return NULL;\n    }\n    BN_POOL_init(&ret->pool);\n    BN_STACK_init(&ret->stack);\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 *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}', 'static void BN_POOL_init(BN_POOL *p)\n{\n    p->head = p->current = p->tail = NULL;\n    p->used = p->size = 0;\n}', 'static void BN_STACK_init(BN_STACK *st)\n{\n    st->indexes = NULL;\n    st->depth = st->size = 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 BN_CTX_free(BN_CTX *ctx)\n{\n    if (ctx == NULL)\n        return;\n#ifdef BN_CTX_DEBUG\n    {\n        BN_POOL_ITEM *pool = ctx->pool.head;\n        fprintf(stderr, "BN_CTX_free, stack-size=%d, pool-bignums=%d\\n",\n                ctx->stack.size, ctx->pool.size);\n        fprintf(stderr, "dmaxs: ");\n        while (pool) {\n            unsigned loop = 0;\n            while (loop < BN_CTX_POOL_SIZE)\n                fprintf(stderr, "%02x ", pool->vals[loop++].dmax);\n            pool = pool->next;\n        }\n        fprintf(stderr, "\\n");\n    }\n#endif\n    BN_STACK_finish(&ctx->stack);\n    BN_POOL_finish(&ctx->pool);\n    OPENSSL_free(ctx);\n}', 'static void BN_STACK_finish(BN_STACK *st)\n{\n    OPENSSL_free(st->indexes);\n    st->indexes = NULL;\n}', 'void CRYPTO_free(void *str)\n{\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}', 'static void BN_POOL_finish(BN_POOL *p)\n{\n    unsigned int loop;\n    BIGNUM *bn;\n    while (p->head) {\n        for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++)\n            if (bn->d)\n                BN_clear_free(bn);\n        p->current = p->head->next;\n        OPENSSL_free(p->head);\n        p->head = p->current;\n    }\n}', 'void BN_clear_free(BIGNUM *a)\n{\n    int i;\n    if (a == NULL)\n        return;\n    bn_check_top(a);\n    if (a->d != NULL) {\n        OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0]));\n        if (!BN_get_flags(a, BN_FLG_STATIC_DATA))\n            bn_free_d(a);\n    }\n    i = BN_get_flags(a, BN_FLG_MALLOCED);\n    OPENSSL_cleanse(a, sizeof(*a));\n    if (i)\n        OPENSSL_free(a);\n}', 'int BN_get_flags(const BIGNUM *b, int n)\n{\n    return b->flags & n;\n}']