crypto/engine/eng_lib.c:189: error: MEMORY_LEAK
  memory dynamically allocated by call to `int_cleanup_item()` at line 187, column 12 is not reachable after line 189, column 9.
Showing all 46 steps of the trace


crypto/engine/eng_lib.c:182:1: start of procedure engine_cleanup_add_last()
180.   }
181.   
182. > void engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb)
183.   {
184.       ENGINE_CLEANUP_ITEM *item;

crypto/engine/eng_lib.c:185:10: 
183.   {
184.       ENGINE_CLEANUP_ITEM *item;
185. >     if (!int_cleanup_check(1))
186.           return;
187.       item = int_cleanup_item(cb);

crypto/engine/eng_lib.c:153:1: start of procedure int_cleanup_check()
  151.    */
  152.   static STACK_OF(ENGINE_CLEANUP_ITEM) *cleanup_stack = NULL;
  153. > static int int_cleanup_check(int create)
  154.   {
  155.       if (cleanup_stack)

crypto/engine/eng_lib.c:155:9: Taking true branch
  153.   static int int_cleanup_check(int create)
  154.   {
  155.       if (cleanup_stack)
                 ^
  156.           return 1;
  157.       if (!create)

crypto/engine/eng_lib.c:156:9: 
  154.   {
  155.       if (cleanup_stack)
  156. >         return 1;
  157.       if (!create)
  158.           return 0;

crypto/engine/eng_lib.c:161:1: return from a call to int_cleanup_check
  159.       cleanup_stack = sk_ENGINE_CLEANUP_ITEM_new_null();
  160.       return (cleanup_stack ? 1 : 0);
  161. > }
  162.   
  163.   static ENGINE_CLEANUP_ITEM *int_cleanup_item(ENGINE_CLEANUP_CB *cb)

crypto/engine/eng_lib.c:185:10: Taking false branch
183.   {
184.       ENGINE_CLEANUP_ITEM *item;
185.       if (!int_cleanup_check(1))
                ^
186.           return;
187.       item = int_cleanup_item(cb);

crypto/engine/eng_lib.c:187:5: 
185.       if (!int_cleanup_check(1))
186.           return;
187. >     item = int_cleanup_item(cb);
188.       if (item)
189.           sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item);

crypto/engine/eng_lib.c:163:1: start of procedure int_cleanup_item()
  161.   }
  162.   
  163. > static ENGINE_CLEANUP_ITEM *int_cleanup_item(ENGINE_CLEANUP_CB *cb)
  164.   {
  165.       ENGINE_CLEANUP_ITEM *item = OPENSSL_malloc(sizeof(*item));

crypto/engine/eng_lib.c:165:5: 
  163.   static ENGINE_CLEANUP_ITEM *int_cleanup_item(ENGINE_CLEANUP_CB *cb)
  164.   {
  165. >     ENGINE_CLEANUP_ITEM *item = OPENSSL_malloc(sizeof(*item));
  166.       if (item == NULL)
  167.           return NULL;

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
    118.   }
    119.   
    120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122.       void *ret = NULL;

crypto/mem.c:122:5: 
    120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122. >     void *ret = NULL;
    123.   
    124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
    122.       void *ret = NULL;
    123.   
    124.       if (num <= 0)
                   ^
    125.           return NULL;
    126.   

crypto/mem.c:127:5: 
    125.           return NULL;
    126.   
    127. >     allow_customize = 0;
    128.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
    135.       }
    136.   #else
    137. >     (void)file;
    138.       (void)line;
    139.       ret = malloc(num);

crypto/mem.c:138:5: 
    136.   #else
    137.       (void)file;
    138. >     (void)line;
    139.       ret = malloc(num);
    140.   #endif

crypto/mem.c:139:5: 
    137.       (void)file;
    138.       (void)line;
    139. >     ret = malloc(num);
    140.   #endif
    141.   

crypto/mem.c:154:5: 
    152.   #endif
    153.   
    154. >     return ret;
    155.   }
    156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
    153.   
    154.       return ret;
    155. > }
    156.   
    157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/engine/eng_lib.c:166:9: Taking false branch
  164.   {
  165.       ENGINE_CLEANUP_ITEM *item = OPENSSL_malloc(sizeof(*item));
  166.       if (item == NULL)
                 ^
  167.           return NULL;
  168.       item->cb = cb;

crypto/engine/eng_lib.c:168:5: 
  166.       if (item == NULL)
  167.           return NULL;
  168. >     item->cb = cb;
  169.       return item;
  170.   }

crypto/engine/eng_lib.c:169:5: 
  167.           return NULL;
  168.       item->cb = cb;
  169. >     return item;
  170.   }
  171.   

crypto/engine/eng_lib.c:170:1: return from a call to int_cleanup_item
  168.       item->cb = cb;
  169.       return item;
  170. > }
  171.   
  172.   void engine_cleanup_add_first(ENGINE_CLEANUP_CB *cb)

crypto/engine/eng_lib.c:188:9: Taking true branch
186.           return;
187.       item = int_cleanup_item(cb);
188.       if (item)
               ^
189.           sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item);
190.   }

crypto/engine/eng_lib.c:189:9: 
187.       item = int_cleanup_item(cb);
188.       if (item)
189. >         sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item);
190.   }
191.   

crypto/engine/eng_int.h:109:1: start of procedure sk_ENGINE_CLEANUP_ITEM_push()
  107.       ENGINE_CLEANUP_CB *cb;
  108.   } ENGINE_CLEANUP_ITEM;
  109. > DEFINE_STACK_OF(ENGINE_CLEANUP_ITEM)
  110.   void engine_cleanup_add_first(ENGINE_CLEANUP_CB *cb);
  111.   void engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb);

crypto/stack/stack.c:259:1: start of procedure sk_push()
    257.   }
    258.   
    259. > int sk_push(_STACK *st, void *data)
    260.   {
    261.       return (sk_insert(st, data, st->num));

crypto/stack/stack.c:261:5: 
    259.   int sk_push(_STACK *st, void *data)
    260.   {
    261. >     return (sk_insert(st, data, st->num));
    262.   }
    263.   

crypto/stack/stack.c:167:1: start of procedure sk_insert()
      165.   }
      166.   
      167. > int sk_insert(_STACK *st, void *data, int loc)
      168.   {
      169.       char **s;

crypto/stack/stack.c:171:9: Taking false branch
      169.       char **s;
      170.   
      171.       if (st == NULL)
                     ^
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {

crypto/stack/stack.c:173:9: Taking true branch
      171.       if (st == NULL)
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {
                     ^
      174.           s = OPENSSL_realloc((char *)st->data,
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);

crypto/stack/stack.c:174:9: 
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {
      174. >         s = OPENSSL_realloc((char *)st->data,
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
      176.           if (s == NULL)

crypto/mem.c:166:1: start of procedure CRYPTO_realloc()
        164.   }
        165.   
        166. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
        167.   {
        168.       if (str == NULL)

crypto/mem.c:168:9: Taking true branch
        166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
        167.   {
        168.       if (str == NULL)
                       ^
        169.           return CRYPTO_malloc(num, file, line);
        170.   

crypto/mem.c:169:9: 
        167.   {
        168.       if (str == NULL)
        169. >         return CRYPTO_malloc(num, file, line);
        170.   
        171.       if (num == 0) {

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
          118.   }
          119.   
          120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
          121.   {
          122.       void *ret = NULL;

crypto/mem.c:122:5: 
          120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
          121.   {
          122. >     void *ret = NULL;
          123.   
          124.       if (num <= 0)

crypto/mem.c:124:9: Taking true branch
          122.       void *ret = NULL;
          123.   
          124.       if (num <= 0)
                         ^
          125.           return NULL;
          126.   

crypto/mem.c:125:9: 
          123.   
          124.       if (num <= 0)
          125. >         return NULL;
          126.   
          127.       allow_customize = 0;

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
          153.   
          154.       return ret;
          155. > }
          156.   
          157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:191:1: return from a call to CRYPTO_realloc
        189.       return realloc(str, num);
        190.   
        191. > }
        192.   
        193.   void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,

crypto/stack/stack.c:176:13: Taking true branch
      174.           s = OPENSSL_realloc((char *)st->data,
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
      176.           if (s == NULL)
                         ^
      177.               return (0);
      178.           st->data = s;

crypto/stack/stack.c:177:13: 
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
      176.           if (s == NULL)
      177. >             return (0);
      178.           st->data = s;
      179.           st->num_alloc *= 2;

crypto/stack/stack.c:191:1: return from a call to sk_insert
      189.       st->sorted = 0;
      190.       return (st->num);
      191. > }
      192.   
      193.   void *sk_delete_ptr(_STACK *st, void *p)

crypto/stack/stack.c:262:1: return from a call to sk_push
    260.   {
    261.       return (sk_insert(st, data, st->num));
    262. > }
    263.   
    264.   int sk_unshift(_STACK *st, void *data)

crypto/engine/eng_int.h:109:1: return from a call to sk_ENGINE_CLEANUP_ITEM_push
  107.       ENGINE_CLEANUP_CB *cb;
  108.   } ENGINE_CLEANUP_ITEM;
  109. > DEFINE_STACK_OF(ENGINE_CLEANUP_ITEM)
  110.   void engine_cleanup_add_first(ENGINE_CLEANUP_CB *cb);
  111.   void engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb);
