crypto/err/err.c:729: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 714, column 11 is not reachable after line 729, column 21.
Showing all 37 steps of the trace


crypto/err/err.c:708:1: start of procedure ERR_add_error_vdata()
706.   }
707.   
708. > void ERR_add_error_vdata(int num, va_list args)
709.   {
710.       int i, n, s;

crypto/err/err.c:713:5: 
711.       char *str, *p, *a;
712.   
713. >     s = 80;
714.       str = OPENSSL_malloc(s + 1);
715.       if (str == NULL)

crypto/err/err.c:714:5: 
712.   
713.       s = 80;
714. >     str = OPENSSL_malloc(s + 1);
715.       if (str == NULL)
716.           return;

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
  156.   #endif
  157.   
  158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  159.   {
  160.       void *ret = NULL;

crypto/mem.c:160:5: 
  158.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  159.   {
  160. >     void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:162:9: Taking false branch
  160.       void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  163.           return malloc_impl(num, file, line);
  164.   

crypto/mem.c:165:9: Taking false branch
  163.           return malloc_impl(num, file, line);
  164.   
  165.       if (num == 0)
                 ^
  166.           return NULL;
  167.   

crypto/mem.c:169:5: 
  167.   
  168.       FAILTEST();
  169. >     allow_customize = 0;
  170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
  177.       }
  178.   #else
  179. >     osslargused(file); osslargused(line);
  180.       ret = malloc(num);
  181.   #endif

crypto/mem.c:179:24: 
  177.       }
  178.   #else
  179. >     osslargused(file); osslargused(line);
  180.       ret = malloc(num);
  181.   #endif

crypto/mem.c:180:5: 
  178.   #else
  179.       osslargused(file); osslargused(line);
  180. >     ret = malloc(num);
  181.   #endif
  182.   

crypto/mem.c:183:5: 
  181.   #endif
  182.   
  183. >     return ret;
  184.   }
  185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
  182.   
  183.       return ret;
  184. > }
  185.   
  186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/err/err.c:715:9: Taking false branch
713.       s = 80;
714.       str = OPENSSL_malloc(s + 1);
715.       if (str == NULL)
               ^
716.           return;
717.       str[0] = '\0';

crypto/err/err.c:717:5: 
715.       if (str == NULL)
716.           return;
717. >     str[0] = '\0';
718.   
719.       n = 0;

crypto/err/err.c:719:5: 
717.       str[0] = '\0';
718.   
719. >     n = 0;
720.       for (i = 0; i < num; i++) {
721.           a = va_arg(args, char *);

crypto/err/err.c:720:10: 
718.   
719.       n = 0;
720. >     for (i = 0; i < num; i++) {
721.           a = va_arg(args, char *);
722.           /* ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */

crypto/err/err.c:720:17: Loop condition is true. Entering loop body
718.   
719.       n = 0;
720.       for (i = 0; i < num; i++) {
                       ^
721.           a = va_arg(args, char *);
722.           /* ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */

crypto/err/err.c:721:9: 
719.       n = 0;
720.       for (i = 0; i < num; i++) {
721. >         a = va_arg(args, char *);
722.           /* ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */
723.           if (a != NULL) {

crypto/err/err.c:723:13: Taking true branch
721.           a = va_arg(args, char *);
722.           /* ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */
723.           if (a != NULL) {
                   ^
724.               n += strlen(a);
725.               if (n > s) {

crypto/err/err.c:724:13: 
722.           /* ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */
723.           if (a != NULL) {
724. >             n += strlen(a);
725.               if (n > s) {
726.                   s = n + 20;

crypto/err/err.c:725:17: Taking true branch
723.           if (a != NULL) {
724.               n += strlen(a);
725.               if (n > s) {
                       ^
726.                   s = n + 20;
727.                   p = OPENSSL_realloc(str, s + 1);

crypto/err/err.c:726:17: 
724.               n += strlen(a);
725.               if (n > s) {
726. >                 s = n + 20;
727.                   p = OPENSSL_realloc(str, s + 1);
728.                   if (p == NULL) {

crypto/err/err.c:727:17: 
725.               if (n > s) {
726.                   s = n + 20;
727. >                 p = OPENSSL_realloc(str, s + 1);
728.                   if (p == NULL) {
729.                       OPENSSL_free(str);

crypto/mem.c:196:1: start of procedure CRYPTO_realloc()
  194.   }
  195.   
  196. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  197.   {
  198.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)

crypto/mem.c:198:9: Taking true branch
  196.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  197.   {
  198.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
                 ^
  199.           return realloc_impl(str, num, file, line);
  200.   

crypto/mem.c:198:33: Taking true branch
  196.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  197.   {
  198.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
                                         ^
  199.           return realloc_impl(str, num, file, line);
  200.   

crypto/mem.c:199:9: Skipping __function_pointer__(): unresolved function pointer
  197.   {
  198.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
  199.           return realloc_impl(str, num, file, line);
                 ^
  200.   
  201.       FAILTEST();

crypto/mem.c:224:1: return from a call to CRYPTO_realloc
  222.       return realloc(str, num);
  223.   
  224. > }
  225.   
  226.   void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,

crypto/err/err.c:728:21: Taking true branch
726.                   s = n + 20;
727.                   p = OPENSSL_realloc(str, s + 1);
728.                   if (p == NULL) {
                           ^
729.                       OPENSSL_free(str);
730.                       return;

crypto/err/err.c:729:21: 
727.                   p = OPENSSL_realloc(str, s + 1);
728.                   if (p == NULL) {
729. >                     OPENSSL_free(str);
730.                       return;
731.                   }

crypto/mem.c:253:1: start of procedure CRYPTO_free()
  251.   }
  252.   
  253. > void CRYPTO_free(void *str, const char *file, int line)
  254.   {
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:255:9: Taking true branch
  253.   void CRYPTO_free(void *str, const char *file, int line)
  254.   {
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                 ^
  256.           free_impl(str, file, line);
  257.           return;

crypto/mem.c:255:30: Taking true branch
  253.   void CRYPTO_free(void *str, const char *file, int line)
  254.   {
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                      ^
  256.           free_impl(str, file, line);
  257.           return;

crypto/mem.c:256:9: Skipping __function_pointer__(): unresolved function pointer
  254.   {
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  256.           free_impl(str, file, line);
                 ^
  257.           return;
  258.       }

crypto/mem.c:257:9: 
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  256.           free_impl(str, file, line);
  257. >         return;
  258.       }
  259.   

crypto/mem.c:271:1: return from a call to CRYPTO_free
  269.       free(str);
  270.   #endif
  271. > }
  272.   
  273.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

void ERR_add_error_vdata(int num, va_list args)
{
    int i, n, s;
    char *str, *p, *a;
    s = 80;
    str = OPENSSL_malloc(s + 1);
    if (str == NULL)
        return;
    str[0] = '\0';
    n = 0;
    for (i = 0; i < num; i++) {
        a = va_arg(args, char *);
        if (a != NULL) {
            n += strlen(a);
            if (n > s) {
                s = n + 20;
                p = OPENSSL_realloc(str, s + 1);
                if (p == NULL) {
                    OPENSSL_free(str);
                    return;
                }
                str = p;
            }
            OPENSSL_strlcat(str, a, (size_t)s + 1);
        }
    }
    ERR_set_error_data(str, ERR_TXT_MALLOCED | ERR_TXT_STRING);
}
["void ERR_add_error_vdata(int num, va_list args)\n{\n    int i, n, s;\n    char *str, *p, *a;\n    s = 80;\n    str = OPENSSL_malloc(s + 1);\n    if (str == NULL)\n        return;\n    str[0] = '\\0';\n    n = 0;\n    for (i = 0; i < num; i++) {\n        a = va_arg(args, char *);\n        if (a != NULL) {\n            n += strlen(a);\n            if (n > s) {\n                s = n + 20;\n                p = OPENSSL_realloc(str, s + 1);\n                if (p == NULL) {\n                    OPENSSL_free(str);\n                    return;\n                }\n                str = p;\n            }\n            OPENSSL_strlcat(str, a, (size_t)s + 1);\n        }\n    }\n    ERR_set_error_data(str, ERR_TXT_MALLOCED | ERR_TXT_STRING);\n}", 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num == 0)\n        return NULL;\n    FAILTEST();\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    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)\n{\n    if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)\n        return realloc_impl(str, num, file, line);\n    FAILTEST();\n    if (str == NULL)\n        return CRYPTO_malloc(num, file, line);\n    if (num == 0) {\n        CRYPTO_free(str, file, line);\n        return NULL;\n    }\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        void *ret;\n        CRYPTO_mem_debug_realloc(str, NULL, num, 0, file, line);\n        ret = realloc(str, num);\n        CRYPTO_mem_debug_realloc(str, ret, num, 1, file, line);\n        return ret;\n    }\n#else\n    osslargused(file); osslargused(line);\n#endif\n    return realloc(str, num);\n}', 'void CRYPTO_free(void *str, const char *file, int line)\n{\n    if (free_impl != NULL && free_impl != &CRYPTO_free) {\n        free_impl(str, file, line);\n        return;\n    }\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0, file, line);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1, file, line);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}']