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


crypto/ui/ui_lib.c:347:1: start of procedure UI_dup_info_string()
345.   }
346.   
347. > int UI_dup_info_string(UI *ui, const char *text)
348.   {
349.       char *text_copy = NULL;

crypto/ui/ui_lib.c:349:5: 
347.   int UI_dup_info_string(UI *ui, const char *text)
348.   {
349. >     char *text_copy = NULL;
350.   
351.       if (text) {

crypto/ui/ui_lib.c:351:9: Taking true branch
349.       char *text_copy = NULL;
350.   
351.       if (text) {
               ^
352.           text_copy = OPENSSL_strdup(text);
353.           if (text_copy == NULL) {

crypto/ui/ui_lib.c:352:9: 
350.   
351.       if (text) {
352. >         text_copy = OPENSSL_strdup(text);
353.           if (text_copy == NULL) {
354.               UIerr(UI_F_UI_DUP_INFO_STRING, ERR_R_MALLOC_FAILURE);

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

crypto/o_str.c:125:9: Taking false branch
  123.       size_t size;
  124.   
  125.       if (str == NULL)
                 ^
  126.           return NULL;
  127.       size = strlen(str) + 1;

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

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

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
    117.   }
    118.   
    119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121.       void *ret = NULL;

crypto/mem.c:121:5: 
    119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121. >     void *ret = NULL;
    122.   
    123.       if (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

crypto/mem.c:126:5: 
    124.           return NULL;
    125.   
    126. >     allow_customize = 0;
    127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

crypto/mem.c:138:5: 
    136.       (void)file;
    137.       (void)line;
    138. >     ret = malloc(num);
    139.   #endif
    140.   

crypto/mem.c:153:5: 
    151.   #endif
    152.   
    153. >     return ret;
    154.   }
    155.   

crypto/mem.c:154:1: return from a call to CRYPTO_malloc
    152.   
    153.       return ret;
    154. > }
    155.   
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/o_str.c:129:9: Taking true branch
  127.       size = strlen(str) + 1;
  128.       ret = CRYPTO_malloc(size, file, line);
  129.       if (ret != NULL)
                 ^
  130.           memcpy(ret, str, size);
  131.       return ret;

crypto/o_str.c:130:9: 
  128.       ret = CRYPTO_malloc(size, file, line);
  129.       if (ret != NULL)
  130. >         memcpy(ret, str, size);
  131.       return ret;
  132.   }

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

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

crypto/ui/ui_lib.c:353:13: Taking false branch
351.       if (text) {
352.           text_copy = OPENSSL_strdup(text);
353.           if (text_copy == NULL) {
                   ^
354.               UIerr(UI_F_UI_DUP_INFO_STRING, ERR_R_MALLOC_FAILURE);
355.               return -1;

crypto/ui/ui_lib.c:359:5: Skipping general_allocate_string(): empty list of specs
357.       }
358.   
359.       return general_allocate_string(ui, text_copy, 1, UIT_INFO, 0, NULL,
           ^
360.                                      0, 0, NULL);
361.   }

int UI_dup_info_string(UI *ui, const char *text)
{
    char *text_copy = NULL;
    if (text) {
        text_copy = OPENSSL_strdup(text);
        if (text_copy == NULL) {
            UIerr(UI_F_UI_DUP_INFO_STRING, ERR_R_MALLOC_FAILURE);
            return -1;
        }
    }
    return general_allocate_string(ui, text_copy, 1, UIT_INFO, 0, NULL,
                                   0, 0, NULL);
}
['int UI_dup_info_string(UI *ui, const char *text)\n{\n    char *text_copy = NULL;\n    if (text) {\n        text_copy = OPENSSL_strdup(text);\n        if (text_copy == NULL) {\n            UIerr(UI_F_UI_DUP_INFO_STRING, ERR_R_MALLOC_FAILURE);\n            return -1;\n        }\n    }\n    return general_allocate_string(ui, text_copy, 1, UIT_INFO, 0, NULL,\n                                   0, 0, NULL);\n}', 'char *CRYPTO_strdup(const char *str, const char* file, int line)\n{\n    char *ret;\n    size_t size;\n    if (str == NULL)\n        return NULL;\n    size = strlen(str) + 1;\n    ret = CRYPTO_malloc(size, file, line);\n    if (ret != NULL)\n        memcpy(ret, str, size);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}']