test/lhash_test.c:205: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 199, column 13 is not reachable after line 205, column 9.
Showing all 35 steps of the trace


test/lhash_test.c:185:1: start of procedure test_stress()
183.   }
184.   
185. > static int test_stress(void)
186.   {
187.       LHASH_OF(int) *h = lh_int_new(&stress_hash, &int_cmp);

test/lhash_test.c:187:5: 
185.   static int test_stress(void)
186.   {
187. >     LHASH_OF(int) *h = lh_int_new(&stress_hash, &int_cmp);
188.       const unsigned int n = 2500000;
189.       unsigned int i;

test/lhash_test.c:34:1: start of procedure lh_int_new()
  32.   #endif
  33.   
  34. > DEFINE_LHASH_OF(int);
  35.   
  36.   static int int_tests[] = { 65537, 13, 1, 3, -5, 6, 7, 4, -10, -12, -14, 22, 9,

test/lhash_test.c:34:1: return from a call to lh_int_new
  32.   #endif
  33.   
  34. > DEFINE_LHASH_OF(int);
  35.   
  36.   static int int_tests[] = { 65537, 13, 1, 3, -5, 6, 7, 4, -10, -12, -14, 22, 9,

test/lhash_test.c:188:5: 
186.   {
187.       LHASH_OF(int) *h = lh_int_new(&stress_hash, &int_cmp);
188. >     const unsigned int n = 2500000;
189.       unsigned int i;
190.       int testresult = 0, *p;

test/lhash_test.c:190:5: 
188.       const unsigned int n = 2500000;
189.       unsigned int i;
190. >     int testresult = 0, *p;
191.   
192.       if (h == NULL) {

test/lhash_test.c:192:9: Taking false branch
190.       int testresult = 0, *p;
191.   
192.       if (h == NULL) {
               ^
193.           fprintf(stderr, "test lhash stress allocation\n");
194.           goto end;

test/lhash_test.c:198:10: 
196.   
197.       /* insert */
198. >     for (i = 0; i < n; i++) {
199.           p = OPENSSL_malloc(sizeof(i));
200.           if (p == NULL) {

test/lhash_test.c:198:17: Loop condition is true. Entering loop body
196.   
197.       /* insert */
198.       for (i = 0; i < n; i++) {
                       ^
199.           p = OPENSSL_malloc(sizeof(i));
200.           if (p == NULL) {

test/lhash_test.c:199:9: 
197.       /* insert */
198.       for (i = 0; i < n; i++) {
199. >         p = OPENSSL_malloc(sizeof(i));
200.           if (p == NULL) {
201.               fprintf(stderr, "test lhash stress out of memory %d\n", i);

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
  156.   #endif
  157.   
  158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  159.   {
  160.       void *ret = NULL;

crypto/mem.c:160:5: 
  158.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  159.   {
  160. >     void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:162:9: Taking false branch
  160.       void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  163.           return malloc_impl(num, file, line);
  164.   

crypto/mem.c:165:9: Taking false branch
  163.           return malloc_impl(num, file, line);
  164.   
  165.       if (num == 0)
                 ^
  166.           return NULL;
  167.   

crypto/mem.c:169:5: 
  167.   
  168.       FAILTEST();
  169. >     allow_customize = 0;
  170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
  177.       }
  178.   #else
  179. >     osslargused(file); osslargused(line);
  180.       ret = malloc(num);
  181.   #endif

crypto/mem.c:179:24: 
  177.       }
  178.   #else
  179. >     osslargused(file); osslargused(line);
  180.       ret = malloc(num);
  181.   #endif

crypto/mem.c:180:5: 
  178.   #else
  179.       osslargused(file); osslargused(line);
  180. >     ret = malloc(num);
  181.   #endif
  182.   

crypto/mem.c:183:5: 
  181.   #endif
  182.   
  183. >     return ret;
  184.   }
  185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
  182.   
  183.       return ret;
  184. > }
  185.   
  186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

test/lhash_test.c:200:13: Taking false branch
198.       for (i = 0; i < n; i++) {
199.           p = OPENSSL_malloc(sizeof(i));
200.           if (p == NULL) {
                   ^
201.               fprintf(stderr, "test lhash stress out of memory %d\n", i);
202.               goto end;

test/lhash_test.c:204:9: 
202.               goto end;
203.           }
204. >         *p = 3 * i + 1;
205.           lh_int_insert(h, p);
206.       }

test/lhash_test.c:205:9: 
203.           }
204.           *p = 3 * i + 1;
205. >         lh_int_insert(h, p);
206.       }
207.   

test/lhash_test.c:34:1: start of procedure lh_int_insert()
  32.   #endif
  33.   
  34. > DEFINE_LHASH_OF(int);
  35.   
  36.   static int int_tests[] = { 65537, 13, 1, 3, -5, 6, 7, 4, -10, -12, -14, 22, 9,

crypto/lhash/lhash.c:70:1: start of procedure OPENSSL_LH_insert()
    68.   }
    69.   
    70. > void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data)
    71.   {
    72.       unsigned long hash;

crypto/lhash/lhash.c:76:5: 
    74.       void *ret;
    75.   
    76. >     lh->error = 0;
    77.       if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
    78.           return NULL;        /* 'lh->error++' already done in 'expand' */

crypto/lhash/lhash.c:77:10: Taking false branch
    75.   
    76.       lh->error = 0;
    77.       if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
                   ^
    78.           return NULL;        /* 'lh->error++' already done in 'expand' */
    79.   

crypto/lhash/lhash.c:80:5: Skipping getrn(): empty list of specs
    78.           return NULL;        /* 'lh->error++' already done in 'expand' */
    79.   
    80.       rn = getrn(lh, data, &hash);
              ^
    81.   
    82.       if (*rn == NULL) {

crypto/lhash/lhash.c:82:9: Taking false branch
    80.       rn = getrn(lh, data, &hash);
    81.   
    82.       if (*rn == NULL) {
                  ^
    83.           if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
    84.               lh->error++;

crypto/lhash/lhash.c:96:9: 
    94.       } else {                    /* replace same key */
    95.   
    96. >         ret = (*rn)->data;
    97.           (*rn)->data = data;
    98.           lh->num_replace++;

crypto/lhash/lhash.c:97:9: 
    95.   
    96.           ret = (*rn)->data;
    97. >         (*rn)->data = data;
    98.           lh->num_replace++;
    99.       }

crypto/lhash/lhash.c:98:9: 
    96.           ret = (*rn)->data;
    97.           (*rn)->data = data;
    98. >         lh->num_replace++;
    99.       }
    100.       return (ret);

crypto/lhash/lhash.c:100:5: 
    98.           lh->num_replace++;
    99.       }
    100. >     return (ret);
    101.   }
    102.   

crypto/lhash/lhash.c:101:1: return from a call to OPENSSL_LH_insert
    99.       }
    100.       return (ret);
    101. > }
    102.   
    103.   void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)

test/lhash_test.c:34:1: return from a call to lh_int_insert
  32.   #endif
  33.   
  34. > DEFINE_LHASH_OF(int);
  35.   
  36.   static int int_tests[] = { 65537, 13, 1, 3, -5, 6, 7, 4, -10, -12, -14, 22, 9,
