crypto/ui/ui_lib.c:220: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_strdup()` at line 213, column 23 is not reachable after line 220, column 5.
Showing all 30 steps of the trace


crypto/ui/ui_lib.c:207:1: start of procedure UI_dup_input_string()
205.   
206.   /* Same as UI_add_input_string(), excepts it takes a copy of the prompt */
207. > int UI_dup_input_string(UI *ui, const char *prompt, int flags,
208.                           char *result_buf, int minsize, int maxsize)
209.   {

crypto/ui/ui_lib.c:210:5: 
208.                           char *result_buf, int minsize, int maxsize)
209.   {
210. >     char *prompt_copy = NULL;
211.   
212.       if (prompt != NULL) {

crypto/ui/ui_lib.c:212:9: Taking true branch
210.       char *prompt_copy = NULL;
211.   
212.       if (prompt != NULL) {
               ^
213.           prompt_copy = OPENSSL_strdup(prompt);
214.           if (prompt_copy == NULL) {

crypto/ui/ui_lib.c:213:9: 
211.   
212.       if (prompt != NULL) {
213. >         prompt_copy = OPENSSL_strdup(prompt);
214.           if (prompt_copy == NULL) {
215.               UIerr(UI_F_UI_DUP_INPUT_STRING, ERR_R_MALLOC_FAILURE);

crypto/o_str.c:27:1: start of procedure CRYPTO_strdup()
  25.   }
  26.   
  27. > char *CRYPTO_strdup(const char *str, const char* file, int line)
  28.   {
  29.       char *ret;

crypto/o_str.c:32:9: Taking false branch
  30.       size_t size;
  31.   
  32.       if (str == NULL)
                ^
  33.           return NULL;
  34.       size = strlen(str) + 1;

crypto/o_str.c:34:5: 
  32.       if (str == NULL)
  33.           return NULL;
  34. >     size = strlen(str) + 1;
  35.       ret = CRYPTO_malloc(size, file, line);
  36.       if (ret != NULL)

crypto/o_str.c:35:5: 
  33.           return NULL;
  34.       size = strlen(str) + 1;
  35. >     ret = CRYPTO_malloc(size, file, line);
  36.       if (ret != NULL)
  37.           memcpy(ret, str, size);

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
    167.   #endif
    168.   
    169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    170.   {
    171.       void *ret = NULL;

crypto/mem.c:171:5: 
    169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    170.   {
    171. >     void *ret = NULL;
    172.   
    173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking false branch
    171.       void *ret = NULL;
    172.   
    173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    174.           return malloc_impl(num, file, line);
    175.   

crypto/mem.c:176:9: Taking false branch
    174.           return malloc_impl(num, file, line);
    175.   
    176.       if (num == 0)
                   ^
    177.           return NULL;
    178.   

crypto/mem.c:180:5: 
    178.   
    179.       FAILTEST();
    180. >     allow_customize = 0;
    181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
    188.       }
    189.   #else
    190. >     (void)(file); (void)(line);
    191.       ret = malloc(num);
    192.   #endif

crypto/mem.c:190:19: 
    188.       }
    189.   #else
    190. >     (void)(file); (void)(line);
    191.       ret = malloc(num);
    192.   #endif

crypto/mem.c:191:5: 
    189.   #else
    190.       (void)(file); (void)(line);
    191. >     ret = malloc(num);
    192.   #endif
    193.   

crypto/mem.c:194:5: 
    192.   #endif
    193.   
    194. >     return ret;
    195.   }
    196.   

crypto/mem.c:195:1: return from a call to CRYPTO_malloc
    193.   
    194.       return ret;
    195. > }
    196.   
    197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/o_str.c:36:9: Taking true branch
  34.       size = strlen(str) + 1;
  35.       ret = CRYPTO_malloc(size, file, line);
  36.       if (ret != NULL)
                ^
  37.           memcpy(ret, str, size);
  38.       return ret;

crypto/o_str.c:37:9: 
  35.       ret = CRYPTO_malloc(size, file, line);
  36.       if (ret != NULL)
  37. >         memcpy(ret, str, size);
  38.       return ret;
  39.   }

crypto/o_str.c:38:5: 
  36.       if (ret != NULL)
  37.           memcpy(ret, str, size);
  38. >     return ret;
  39.   }
  40.   

crypto/o_str.c:39:1: return from a call to CRYPTO_strdup
  37.           memcpy(ret, str, size);
  38.       return ret;
  39. > }
  40.   
  41.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

crypto/ui/ui_lib.c:214:13: Taking false branch
212.       if (prompt != NULL) {
213.           prompt_copy = OPENSSL_strdup(prompt);
214.           if (prompt_copy == NULL) {
                   ^
215.               UIerr(UI_F_UI_DUP_INPUT_STRING, ERR_R_MALLOC_FAILURE);
216.               return 0;

crypto/ui/ui_lib.c:220:5: 
218.       }
219.   
220. >     return general_allocate_string(ui, prompt_copy, 1,
221.                                      UIT_PROMPT, flags, result_buf, minsize,
222.                                      maxsize, NULL);

crypto/ui/ui_lib.c:119:1: start of procedure general_allocate_string()
  117.   }
  118.   
  119. > static int general_allocate_string(UI *ui, const char *prompt,
  120.                                      int prompt_freeable,
  121.                                      enum UI_string_types type, int input_flags,

crypto/ui/ui_lib.c:125:5: 
  123.                                      const char *test_buf)
  124.   {
  125. >     int ret = -1;
  126.       UI_STRING *s = general_allocate_prompt(ui, prompt, prompt_freeable,
  127.                                              type, input_flags, result_buf);

crypto/ui/ui_lib.c:126:5: Skipping general_allocate_prompt(): empty list of specs
  124.   {
  125.       int ret = -1;
  126.       UI_STRING *s = general_allocate_prompt(ui, prompt, prompt_freeable,
             ^
  127.                                              type, input_flags, result_buf);
  128.   

crypto/ui/ui_lib.c:129:9: Taking false branch
  127.                                              type, input_flags, result_buf);
  128.   
  129.       if (s != NULL) {
                 ^
  130.           if (allocate_string_stack(ui) >= 0) {
  131.               s->_.string_data.result_minsize = minsize;

crypto/ui/ui_lib.c:143:5: 
  141.               free_string(s);
  142.       }
  143. >     return ret;
  144.   }
  145.   

crypto/ui/ui_lib.c:144:1: return from a call to general_allocate_string
  142.       }
  143.       return ret;
  144. > }
  145.   
  146.   static int general_allocate_boolean(UI *ui,
