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


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

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

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

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

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

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

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

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

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
    69.   }
    70.   
    71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73.       void *ret = NULL;

crypto/mem.c:73:5: 
    71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73. >     void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
    73.       void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                  ^
    76.           return malloc_impl(num, file, line);
    77.   

crypto/mem.c:78:9: Taking false branch
    76.           return malloc_impl(num, file, line);
    77.   
    78.       if (num <= 0)
                  ^
    79.           return NULL;
    80.   

crypto/mem.c:81:5: 
    79.           return NULL;
    80.   
    81. >     allow_customize = 0;
    82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:91:24: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:92:5: 
    90.   #else
    91.       osslargused(file); osslargused(line);
    92. >     ret = malloc(num);
    93.   #endif
    94.   

crypto/mem.c:95:5: 
    93.   #endif
    94.   
    95. >     return ret;
    96.   }
    97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
    94.   
    95.       return ret;
    96. > }
    97.   
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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

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

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

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

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

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

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

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

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

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

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

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