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 29 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:31:9: Taking false branch
  29.       char *ret;
  30.   
  31.       if (str == NULL)
                ^
  32.           return NULL;
  33.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);

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

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
    187.   #endif
    188.   
    189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    190.   {
    191.       void *ret = NULL;

crypto/mem.c:191:5: 
    189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    190.   {
    191. >     void *ret = NULL;
    192.   
    193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking false branch
    192.   
    193.       INCREMENT(malloc_count);
    194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    195.           return malloc_impl(num, file, line);
    196.   

crypto/mem.c:197:9: Taking false branch
    195.           return malloc_impl(num, file, line);
    196.   
    197.       if (num == 0)
                   ^
    198.           return NULL;
    199.   

crypto/mem.c:201:5: 
    199.   
    200.       FAILTEST();
    201. >     allow_customize = 0;
    202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    203.       if (call_malloc_debug) {

crypto/mem.c:211:5: 
    209.       }
    210.   #else
    211. >     (void)(file); (void)(line);
    212.       ret = malloc(num);
    213.   #endif

crypto/mem.c:211:19: 
    209.       }
    210.   #else
    211. >     (void)(file); (void)(line);
    212.       ret = malloc(num);
    213.   #endif

crypto/mem.c:212:5: 
    210.   #else
    211.       (void)(file); (void)(line);
    212. >     ret = malloc(num);
    213.   #endif
    214.   

crypto/mem.c:215:5: 
    213.   #endif
    214.   
    215. >     return ret;
    216.   }
    217.   

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
    214.   
    215.       return ret;
    216. > }
    217.   
    218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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

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

crypto/o_str.c:36:5: 
  34.       if (ret != NULL)
  35.           strcpy(ret, str);
  36. >     return ret;
  37.   }
  38.   

crypto/o_str.c:37:1: return from a call to CRYPTO_strdup
  35.           strcpy(ret, str);
  36.       return ret;
  37. > }
  38.   
  39.   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,
