crypto/conf/conf_mod.c:294: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_strdup()` at line 289, column 18 is not reachable after line 294, column 9.
Showing all 68 steps of the trace


crypto/conf/conf_mod.c:276:1: start of procedure module_add()
274.   
275.   /* add module to list */
276. > static CONF_MODULE *module_add(DSO *dso, const char *name,
277.                                  conf_init_func *ifunc, conf_finish_func *ffunc)
278.   {

crypto/conf/conf_mod.c:279:5: 
277.                                  conf_init_func *ifunc, conf_finish_func *ffunc)
278.   {
279. >     CONF_MODULE *tmod = NULL;
280.       if (supported_modules == NULL)
281.           supported_modules = sk_CONF_MODULE_new_null();

crypto/conf/conf_mod.c:280:9: Taking false branch
278.   {
279.       CONF_MODULE *tmod = NULL;
280.       if (supported_modules == NULL)
               ^
281.           supported_modules = sk_CONF_MODULE_new_null();
282.       if (supported_modules == NULL)

crypto/conf/conf_mod.c:282:9: Taking false branch
280.       if (supported_modules == NULL)
281.           supported_modules = sk_CONF_MODULE_new_null();
282.       if (supported_modules == NULL)
               ^
283.           return NULL;
284.       tmod = OPENSSL_zalloc(sizeof(*tmod));

crypto/conf/conf_mod.c:284:5: 
282.       if (supported_modules == NULL)
283.           return NULL;
284. >     tmod = OPENSSL_zalloc(sizeof(*tmod));
285.       if (tmod == NULL)
286.           return NULL;

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

crypto/mem.c:159:5: 
  157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  158.   {
  159. >     void *ret = CRYPTO_malloc(num, file, line);
  160.   
  161.       if (ret != 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/mem.c:161:9: Taking true branch
  159.       void *ret = CRYPTO_malloc(num, file, line);
  160.   
  161.       if (ret != NULL)
                 ^
  162.           memset(ret, 0, num);
  163.       return ret;

crypto/mem.c:162:9: 
  160.   
  161.       if (ret != NULL)
  162. >         memset(ret, 0, num);
  163.       return ret;
  164.   }

crypto/mem.c:163:5: 
  161.       if (ret != NULL)
  162.           memset(ret, 0, num);
  163. >     return ret;
  164.   }
  165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
  162.           memset(ret, 0, num);
  163.       return ret;
  164. > }
  165.   
  166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/conf/conf_mod.c:285:9: Taking false branch
283.           return NULL;
284.       tmod = OPENSSL_zalloc(sizeof(*tmod));
285.       if (tmod == NULL)
               ^
286.           return NULL;
287.   

crypto/conf/conf_mod.c:288:5: 
286.           return NULL;
287.   
288. >     tmod->dso = dso;
289.       tmod->name = OPENSSL_strdup(name);
290.       tmod->init = ifunc;

crypto/conf/conf_mod.c:289:5: 
287.   
288.       tmod->dso = dso;
289. >     tmod->name = OPENSSL_strdup(name);
290.       tmod->init = ifunc;
291.       tmod->finish = ffunc;

crypto/o_str.c:121:1: start of procedure CRYPTO_strdup()
  119.   }
  120.   
  121. > char *CRYPTO_strdup(const char *str, const char* file, int line)
  122.   {
  123.       char *ret;

crypto/o_str.c:125:9: Taking false branch
  123.       char *ret;
  124.   
  125.       if (str == NULL)
                 ^
  126.           return NULL;
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);

crypto/o_str.c:127:5: 
  125.       if (str == NULL)
  126.           return NULL;
  127. >     ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
  129.           strcpy(ret, str);

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/o_str.c:128:9: Taking true branch
  126.           return NULL;
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
                 ^
  129.           strcpy(ret, str);
  130.       return ret;

crypto/o_str.c:129:9: 
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
  129. >         strcpy(ret, str);
  130.       return ret;
  131.   }

crypto/o_str.c:130:5: 
  128.       if (ret != NULL)
  129.           strcpy(ret, str);
  130. >     return ret;
  131.   }
  132.   

crypto/o_str.c:131:1: return from a call to CRYPTO_strdup
  129.           strcpy(ret, str);
  130.       return ret;
  131. > }
  132.   
  133.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

crypto/conf/conf_mod.c:290:5: 
288.       tmod->dso = dso;
289.       tmod->name = OPENSSL_strdup(name);
290. >     tmod->init = ifunc;
291.       tmod->finish = ffunc;
292.   

crypto/conf/conf_mod.c:291:5: 
289.       tmod->name = OPENSSL_strdup(name);
290.       tmod->init = ifunc;
291. >     tmod->finish = ffunc;
292.   
293.       if (!sk_CONF_MODULE_push(supported_modules, tmod)) {

crypto/conf/conf_mod.c:293:10: 
291.       tmod->finish = ffunc;
292.   
293. >     if (!sk_CONF_MODULE_push(supported_modules, tmod)) {
294.           OPENSSL_free(tmod);
295.           return NULL;

include/openssl/conf.h:105:1: start of procedure sk_CONF_MODULE_push()
  103.   typedef struct conf_module_st CONF_MODULE;
  104.   
  105. > DEFINE_STACK_OF(CONF_MODULE)
  106.   DEFINE_STACK_OF(CONF_IMODULE)
  107.   

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)

include/openssl/conf.h:105:1: return from a call to sk_CONF_MODULE_push
  103.   typedef struct conf_module_st CONF_MODULE;
  104.   
  105. > DEFINE_STACK_OF(CONF_MODULE)
  106.   DEFINE_STACK_OF(CONF_IMODULE)
  107.   

crypto/conf/conf_mod.c:293:10: Taking true branch
291.       tmod->finish = ffunc;
292.   
293.       if (!sk_CONF_MODULE_push(supported_modules, tmod)) {
                ^
294.           OPENSSL_free(tmod);
295.           return NULL;

crypto/conf/conf_mod.c:294:9: 
292.   
293.       if (!sk_CONF_MODULE_push(supported_modules, tmod)) {
294. >         OPENSSL_free(tmod);
295.           return NULL;
296.       }

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

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

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