crypto/engine/eng_dyn.c:400: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_strdup()` at line 395, column 29 is not reachable after line 400, column 13.
Showing all 54 steps of the trace


crypto/engine/eng_dyn.c:333:1: start of procedure dynamic_ctrl()
331.   }
332.   
333. > static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void))
334.   {
335.       dynamic_data_ctx *ctx = dynamic_get_data_ctx(e);

crypto/engine/eng_dyn.c:335:5: Skipping dynamic_get_data_ctx(): empty list of specs
333.   static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void))
334.   {
335.       dynamic_data_ctx *ctx = dynamic_get_data_ctx(e);
           ^
336.       int initialised;
337.   

crypto/engine/eng_dyn.c:338:10: Taking false branch
336.       int initialised;
337.   
338.       if (!ctx) {
                ^
339.           ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ENGINE_R_NOT_LOADED);
340.           return 0;

crypto/engine/eng_dyn.c:342:21: Condition is true
340.           return 0;
341.       }
342.       initialised = ((ctx->dynamic_dso == NULL) ? 0 : 1);
                           ^
343.       /* All our control commands require the ENGINE to be uninitialised */
344.       if (initialised) {

crypto/engine/eng_dyn.c:342:20: 
340.           return 0;
341.       }
342. >     initialised = ((ctx->dynamic_dso == NULL) ? 0 : 1);
343.       /* All our control commands require the ENGINE to be uninitialised */
344.       if (initialised) {

crypto/engine/eng_dyn.c:342:5: 
340.           return 0;
341.       }
342. >     initialised = ((ctx->dynamic_dso == NULL) ? 0 : 1);
343.       /* All our control commands require the ENGINE to be uninitialised */
344.       if (initialised) {

crypto/engine/eng_dyn.c:344:9: Taking false branch
342.       initialised = ((ctx->dynamic_dso == NULL) ? 0 : 1);
343.       /* All our control commands require the ENGINE to be uninitialised */
344.       if (initialised) {
               ^
345.           ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ENGINE_R_ALREADY_LOADED);
346.           return 0;

crypto/engine/eng_dyn.c:348:5: 
346.           return 0;
347.       }
348. >     switch (cmd) {
349.       case DYNAMIC_CMD_SO_PATH:
350.           /* a NULL 'p' or a string of zero-length is the same thing */

crypto/engine/eng_dyn.c:349:5: Switch condition is false. Skipping switch case
347.       }
348.       switch (cmd) {
349.       case DYNAMIC_CMD_SO_PATH:
           ^
350.           /* a NULL 'p' or a string of zero-length is the same thing */
351.           if (p && (strlen((const char *)p) < 1))

crypto/engine/eng_dyn.c:359:5: Switch condition is false. Skipping switch case
357.               ctx->DYNAMIC_LIBNAME = NULL;
358.           return (ctx->DYNAMIC_LIBNAME ? 1 : 0);
359.       case DYNAMIC_CMD_NO_VCHECK:
           ^
360.           ctx->no_vcheck = ((i == 0) ? 0 : 1);
361.           return 1;

crypto/engine/eng_dyn.c:362:5: Switch condition is false. Skipping switch case
360.           ctx->no_vcheck = ((i == 0) ? 0 : 1);
361.           return 1;
362.       case DYNAMIC_CMD_ID:
           ^
363.           /* a NULL 'p' or a string of zero-length is the same thing */
364.           if (p && (strlen((const char *)p) < 1))

crypto/engine/eng_dyn.c:372:5: Switch condition is false. Skipping switch case
370.               ctx->engine_id = NULL;
371.           return (ctx->engine_id ? 1 : 0);
372.       case DYNAMIC_CMD_LIST_ADD:
           ^
373.           if ((i < 0) || (i > 2)) {
374.               ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ENGINE_R_INVALID_ARGUMENT);

crypto/engine/eng_dyn.c:379:5: Switch condition is false. Skipping switch case
377.           ctx->list_add_value = (int)i;
378.           return 1;
379.       case DYNAMIC_CMD_LOAD:
           ^
380.           return dynamic_load(e, ctx);
381.       case DYNAMIC_CMD_DIR_LOAD:

crypto/engine/eng_dyn.c:381:5: Switch condition is false. Skipping switch case
379.       case DYNAMIC_CMD_LOAD:
380.           return dynamic_load(e, ctx);
381.       case DYNAMIC_CMD_DIR_LOAD:
           ^
382.           if ((i < 0) || (i > 2)) {
383.               ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ENGINE_R_INVALID_ARGUMENT);

crypto/engine/eng_dyn.c:388:5: Switch condition is true. Entering switch case
386.           ctx->dir_load = (int)i;
387.           return 1;
388.       case DYNAMIC_CMD_DIR_ADD:
           ^
389.           /* a NULL 'p' or a string of zero-length is the same thing */
390.           if (!p || (strlen((const char *)p) < 1)) {

crypto/engine/eng_dyn.c:390:14: Taking false branch
388.       case DYNAMIC_CMD_DIR_ADD:
389.           /* a NULL 'p' or a string of zero-length is the same thing */
390.           if (!p || (strlen((const char *)p) < 1)) {
                    ^
391.               ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ENGINE_R_INVALID_ARGUMENT);
392.               return 0;

crypto/engine/eng_dyn.c:390:20: Taking false branch
388.       case DYNAMIC_CMD_DIR_ADD:
389.           /* a NULL 'p' or a string of zero-length is the same thing */
390.           if (!p || (strlen((const char *)p) < 1)) {
                          ^
391.               ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ENGINE_R_INVALID_ARGUMENT);
392.               return 0;

crypto/engine/eng_dyn.c:395:13: 
393.           }
394.           {
395. >             char *tmp_str = OPENSSL_strdup(p);
396.               if (!tmp_str) {
397.                   ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ERR_R_MALLOC_FAILURE);

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/engine/eng_dyn.c:396:18: Taking false branch
394.           {
395.               char *tmp_str = OPENSSL_strdup(p);
396.               if (!tmp_str) {
                        ^
397.                   ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ERR_R_MALLOC_FAILURE);
398.                   return 0;

crypto/engine/eng_dyn.c:400:13: 
398.                   return 0;
399.               }
400. >             sk_OPENSSL_STRING_insert(ctx->dirs, tmp_str, -1);
401.           }
402.           return 1;

include/openssl/safestack.h:214:1: start of procedure sk_OPENSSL_STRING_insert()
  212.    * dealt with in the autogenerated macros below.
  213.    */
  214. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
  215.   
  216.   /*

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)

include/openssl/safestack.h:214:1: return from a call to sk_OPENSSL_STRING_insert
  212.    * dealt with in the autogenerated macros below.
  213.    */
  214. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
  215.   
  216.   /*
