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


crypto/err/err.c:730:1: start of procedure ERR_add_error_vdata()
728.   }
729.   
730. > void ERR_add_error_vdata(int num, va_list args)
731.   {
732.       int i, n, s;

crypto/err/err.c:735:5: 
733.       char *str, *p, *a;
734.   
735. >     s = 80;
736.       str = OPENSSL_malloc(s + 1);
737.       if (str == NULL)

crypto/err/err.c:736:5: 
734.   
735.       s = 80;
736. >     str = OPENSSL_malloc(s + 1);
737.       if (str == NULL)
738.           return;

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

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

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

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

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

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

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

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

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

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

crypto/err/err.c:737:9: Taking false branch
735.       s = 80;
736.       str = OPENSSL_malloc(s + 1);
737.       if (str == NULL)
               ^
738.           return;
739.       str[0] = '\0';

crypto/err/err.c:739:5: 
737.       if (str == NULL)
738.           return;
739. >     str[0] = '\0';
740.   
741.       n = 0;

crypto/err/err.c:741:5: 
739.       str[0] = '\0';
740.   
741. >     n = 0;
742.       for (i = 0; i < num; i++) {
743.           a = va_arg(args, char *);

crypto/err/err.c:742:10: 
740.   
741.       n = 0;
742. >     for (i = 0; i < num; i++) {
743.           a = va_arg(args, char *);
744.           if (a == NULL)

crypto/err/err.c:742:17: Loop condition is true. Entering loop body
740.   
741.       n = 0;
742.       for (i = 0; i < num; i++) {
                       ^
743.           a = va_arg(args, char *);
744.           if (a == NULL)

crypto/err/err.c:743:9: 
741.       n = 0;
742.       for (i = 0; i < num; i++) {
743. >         a = va_arg(args, char *);
744.           if (a == NULL)
745.               a = "<NULL>";

crypto/err/err.c:744:13: Taking false branch
742.       for (i = 0; i < num; i++) {
743.           a = va_arg(args, char *);
744.           if (a == NULL)
                   ^
745.               a = "<NULL>";
746.           n += strlen(a);

crypto/err/err.c:746:9: 
744.           if (a == NULL)
745.               a = "<NULL>";
746. >         n += strlen(a);
747.           if (n > s) {
748.               s = n + 20;

crypto/err/err.c:747:13: Taking true branch
745.               a = "<NULL>";
746.           n += strlen(a);
747.           if (n > s) {
                   ^
748.               s = n + 20;
749.               p = OPENSSL_realloc(str, s + 1);

crypto/err/err.c:748:13: 
746.           n += strlen(a);
747.           if (n > s) {
748. >             s = n + 20;
749.               p = OPENSSL_realloc(str, s + 1);
750.               if (p == NULL) {

crypto/err/err.c:749:13: 
747.           if (n > s) {
748.               s = n + 20;
749. >             p = OPENSSL_realloc(str, s + 1);
750.               if (p == NULL) {
751.                   OPENSSL_free(str);

crypto/mem.c:208:1: start of procedure CRYPTO_realloc()
  206.   }
  207.   
  208. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  209.   {
  210.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)

crypto/mem.c:210:9: Taking true branch
  208.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  209.   {
  210.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
                 ^
  211.           return realloc_impl(str, num, file, line);
  212.   

crypto/mem.c:210:33: Taking true branch
  208.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  209.   {
  210.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
                                         ^
  211.           return realloc_impl(str, num, file, line);
  212.   

crypto/mem.c:211:9: Skipping __function_pointer__(): unresolved function pointer
  209.   {
  210.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
  211.           return realloc_impl(str, num, file, line);
                 ^
  212.   
  213.       FAILTEST();

crypto/mem.c:236:1: return from a call to CRYPTO_realloc
  234.       return realloc(str, num);
  235.   
  236. > }
  237.   
  238.   void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,

crypto/err/err.c:750:17: Taking true branch
748.               s = n + 20;
749.               p = OPENSSL_realloc(str, s + 1);
750.               if (p == NULL) {
                       ^
751.                   OPENSSL_free(str);
752.                   return;

crypto/err/err.c:751:17: 
749.               p = OPENSSL_realloc(str, s + 1);
750.               if (p == NULL) {
751. >                 OPENSSL_free(str);
752.                   return;
753.               }

crypto/mem.c:265:1: start of procedure CRYPTO_free()
  263.   }
  264.   
  265. > void CRYPTO_free(void *str, const char *file, int line)
  266.   {
  267.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:267:9: Taking true branch
  265.   void CRYPTO_free(void *str, const char *file, int line)
  266.   {
  267.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                 ^
  268.           free_impl(str, file, line);
  269.           return;

crypto/mem.c:267:30: Taking true branch
  265.   void CRYPTO_free(void *str, const char *file, int line)
  266.   {
  267.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                      ^
  268.           free_impl(str, file, line);
  269.           return;

crypto/mem.c:268:9: Skipping __function_pointer__(): unresolved function pointer
  266.   {
  267.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  268.           free_impl(str, file, line);
                 ^
  269.           return;
  270.       }

crypto/mem.c:269:9: 
  267.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  268.           free_impl(str, file, line);
  269. >         return;
  270.       }
  271.   

crypto/mem.c:283:1: return from a call to CRYPTO_free
  281.       free(str);
  282.   #endif
  283. > }
  284.   
  285.   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)
            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            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    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    (void)(file); (void)(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    (void)(file); (void)(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}']